MCPcopy Create free account
hub / github.com/apache/fory / load_bench_pb2

Function load_bench_pb2

benchmarks/python/benchmark.py:400–411  ·  view source on GitHub ↗
(proto_dir: Path)

Source from the content-addressed store, hash-verified

398
399
400def load_bench_pb2(proto_dir: Path):
401 bench_pb2_path = proto_dir / "bench_pb2.py"
402 if not bench_pb2_path.exists():
403 raise FileNotFoundError(
404 f"{bench_pb2_path} does not exist. Run benchmarks/python/run.sh first to generate protobuf bindings."
405 )
406 proto_dir_abs = str(proto_dir.resolve())
407 if proto_dir_abs not in sys.path:
408 sys.path.insert(0, proto_dir_abs)
409 import bench_pb2 # type: ignore
410
411 return bench_pb2
412
413
414def to_pb_struct(bench_pb2, obj: NumericStruct):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected