MCPcopy Create free account
hub / github.com/NationalSecurityAgency/TraceAnalysis / parse_string

Function parse_string

strace-spark/src/spark/parser/utils.py:209–222  ·  view source on GitHub ↗

TODO

(data: str)

Source from the content-addressed store, hash-verified

207
208
209def parse_string(data: str) -> str:
210 """TODO"""
211
212 try:
213 # NOTE: assumes encasing `"` chars
214 return json.loads(data.rstrip("...")) # type: ignore
215 except json.JSONDecodeError as e:
216 # FIXME: Deal with strace string encodings
217 # I.e. "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \347\0\0\0\0\0\0"...
218
219 WARN("Parse string error: {}", e)
220 WARN("Unable to decode string: {}", data)
221
222 return data
223
224
225def parse_array(data: str) -> tuple[ArgType, ...]:

Callers 1

parse_unitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected