MCPcopy Index your code
hub / github.com/python/cpython / _colorize_json

Function _colorize_json

Lib/json/tool.py:34–41  ·  view source on GitHub ↗
(json_str, theme)

Source from the content-addressed store, hash-verified

32
33
34def _colorize_json(json_str, theme):
35 def _replace_match_callback(match):
36 for group, color in _group_to_theme_color.items():
37 if m := match.group(group):
38 return f"{theme[color]}{m}{theme.reset}"
39 return match.group()
40
41 return re.sub(_color_pattern, _replace_match_callback, json_str)
42
43
44def main():

Callers 1

mainFunction · 0.85

Calls 1

subMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…