MCPcopy Index your code
hub / github.com/SourceCode-AI/aura / json_encoder

Function json_encoder

aura/utils.py:135–150  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

133
134
135def json_encoder(obj):
136 from .analyzers.python.nodes import ASTNode
137
138 if type(obj) in (set, tuple):
139 return list(obj)
140 elif isinstance(obj, Path):
141 return os.fspath(obj.absolute())
142 elif isinstance(obj, ASTNode):
143 return obj.json
144 elif type(obj) == bytes:
145 return obj.decode("utf-8")
146 elif dataclasses.is_dataclass(obj):
147 if hasattr(obj, "_asdict"):
148 return obj._asdict()
149 else:
150 return dataclasses.asdict(obj)
151
152
153def lookup_lines(

Callers

nothing calls this directly

Calls 2

_asdictMethod · 0.80
asdictMethod · 0.45

Tested by

no test coverage detected