Benign python Download

plattli 0.11.0

“Plättli is an opinionated dataformat for logging a series of metrics”

Module built on the numeric Python stackPython opens ZipFile in write mode

Evidence

In-place binary file modification writer.py · lines 175–179
175 indices = np.fromfile(idx_path, dtype=np.uint32)
176 keep = int(np.searchsorted(indices, step, side="left")) if indices.size else 0
177 with idx_path.open("r+b") as fh:
178 fh.truncate(keep * 4)
179 else:
Python json.loads call writer.py · lines 270–277
270 raise FileNotFoundError(f"missing values file for {name} in run {_run_name_for_root(root)}")
271 count = 0
272 lines = path.read_bytes().splitlines()
273 for idx, line in enumerate(lines):
274 try:
275 json.loads(line)
276 except (json.JSONDecodeError, UnicodeDecodeError):
277 if idx == len(lines) - 1:
ExecEnv writes file bytes writer.py · lines 500–503
500 for info, out_path in members:
501 out_path.parent.mkdir(parents=True, exist_ok=True)
502 out_path.write_bytes(zf.read(info))
503 zip_path.unlink()
Imports the NumPy array library bulk_writer.py · lines 1–12
1import json
2import zipfile
3from datetime import datetime, timezone
4from pathlib import Path
5
6import numpy as np
7
8from ._indices import _find_piecewise_params
⋯4 lines
Python opens ZipFile in write mode bulk_writer.py · lines 86–108
86:13… tmp_path = zip_path.with_name(zip_path.name + ".tmp")
87 zf = zipfile.ZipFile(tmp_path, "w", compression=zipfile.ZIP_STORED)
88
89 def write_bytes(name, payload):
⋯9 lines
99 path = self.root / name
100 path.parent.mkdir(parents=True, exist_ok=True)
101 with path.open("wb") as fh:
102 fh.write(payload)
103
⋯5 lines

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.