MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / serialize_result

Function serialize_result

benchmarks/src/executor/serialization.py:17–26  ·  view source on GitHub ↗
(result: BenchmarkResult)

Source from the content-addressed store, hash-verified

15
16
17def serialize_result(result: BenchmarkResult) -> Dict[str, Any]:
18 if isinstance(result, Success):
19 type = "success"
20 elif isinstance(result, Timeout):
21 type = "timeout"
22 elif isinstance(result, Failure):
23 type = "failure"
24 else:
25 assert False
26 return dict(type=type, data=result.to_dict())
27
28
29def deserialize_result(data: Dict[str, Any]) -> BenchmarkResult:

Callers 1

executor_script.pyFile · 0.85

Calls 1

to_dictMethod · 0.80

Tested by

no test coverage detected