MCPcopy
hub / github.com/openai/plugins / input_checksums

Function input_checksums

plugins/ngs-analysis/scripts/ngs_run_utils.py:272–289  ·  view source on GitHub ↗
(inputs: dict[str, Any] | None)

Source from the content-addressed store, hash-verified

270
271
272def input_checksums(inputs: dict[str, Any] | None) -> list[dict[str, Any]]:
273 seen: set[Path] = set()
274 checksums: list[dict[str, Any]] = []
275 for path in _iter_existing_paths(inputs or {}):
276 if path in seen:
277 continue
278 seen.add(path)
279 size = path.stat().st_size
280 record: dict[str, Any] = {"path": str(path), "bytes": size}
281 if size <= MAX_AUTO_CHECKSUM_BYTES:
282 record["sha256"] = sha256_file(path)
283 else:
284 record["sha256"] = None
285 record["sha256_skipped_reason"] = (
286 f"file exceeds {MAX_AUTO_CHECKSUM_BYTES} bytes auto-checksum threshold"
287 )
288 checksums.append(record)
289 return sorted(checksums, key=lambda item: item["path"])
290
291
292def _flatten_declared_paths(value: Any, prefix: str = "") -> list[dict[str, str]]:

Callers 1

write_standard_manifestFunction · 0.85

Calls 4

_iter_existing_pathsFunction · 0.85
sha256_fileFunction · 0.85
statMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected