#!/usr/bin/env python3 """CC0-1.0. Bounded HDF5 VDS dependency experiment using private temporary files.""" import argparse import hashlib import json import os from pathlib import Path import platform import shutil import subprocess import sys import tempfile from datetime import datetime, timezone import h5py import numpy as np CASES = ("present", "missing-file", "missing-dataset", "substituted-source", "legitimate-zero", "relocated-vds-only", "relocated-complete", "prefix-override") LEFT = [11, 12, 13] RIGHT = [21, 22, 23] REPLACEMENT = [91, 92, 93] def require(condition, message): if not condition: raise RuntimeError(message) def sha256(path): return hashlib.sha256(Path(path).read_bytes()).hexdigest() def source(path, values, name="data"): with h5py.File(path, "w", libver="v110", driver="sec2") as handle: handle.create_dataset(name, data=np.array(values, dtype="