#!/usr/bin/env python3 """Read-only process/model accounting, for diagnostics (not deployment runtime).""" import argparse import collections import json from pathlib import Path import re import struct p = argparse.ArgumentParser() p.add_argument("--pid", type=int) p.add_argument("--model", type=Path) a = p.parse_args() result = {} if a.model: categories = collections.Counter() with a.model.open("rb") as f: header = f.read(256) count = struct.unpack_from("