Benign python Download

skeights 0.4.0

legitimate ML serialization library

“Serialize fitted scikit-learn models to safetensors + JSON”

Module built on the numeric Python stackImports the NumPy array library

Evidence

Module built on the numeric Python stack _xgb.py · lines 1–21
⋯13 lines
14from typing import Any
15
16import numpy as np
17from sklearn.base import BaseEstimator
18
19from skeights._handler import EstimatorHandler
20
21# ------------------------------- …
Module built on the numeric Python stack _utils.py · lines 1–18
⋯10 lines
11from typing import Any
12
13import numpy as np
14from sklearn.base import BaseEstimator
15
16
17def json_default(obj: Any) -> Any:
18 """JSON encoder default for numpy types." …
Dynamically imports a Python module _utils.py · lines 33–60
⋯8 lines
41 candidate = ".".join(parts[:i])
42 try:
43 mod = importlib.import_module(candidate)
44 if getattr(mod, cls.__name__, None) is cls:
45 return f"{candidate}.{cls.__name__}"
⋯15 lines
pathlib write_text/write_bytes call _io.py · lines 148–155
148:56… )
149 safetensors.numpy.save_file(arrays, str(arrays_path))
150 Path(state_path).write_text(json.dumps(state, indent=2, default=json_default))
151
152
153def load(
154 arrays_path: str | Path,
155 state_path: str | Pat …
Parses JSON data with Python _io.py · lines 164–168
164:16… reconstructed, ready-to-predict estimator.
165 """
166 state = json.loads(Path(state_path).read_text())
167 arrays = dict(safetensors.numpy.load_file(str(arrays_path)))
168 saved_versions = state.get(" …

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.