MCPcopy Create free account
hub / github.com/CHENGY12/PLOT / write_json

Function write_json

plot-adapter/datasets/utils.py:22–27  ·  view source on GitHub ↗

Writes to a json file.

(obj, fpath)

Source from the content-addressed store, hash-verified

20
21
22def write_json(obj, fpath):
23 """Writes to a json file."""
24 if not osp.exists(osp.dirname(fpath)):
25 os.makedirs(osp.dirname(fpath))
26 with open(fpath, 'w') as f:
27 json.dump(obj, f, indent=4, separators=(',', ': '))
28
29
30def read_image(path):

Callers 3

save_splitMethod · 0.90
save_splitMethod · 0.90
save_splitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected