MCPcopy Create free account
hub / github.com/JaydenLyh/Reward-Forcing / write_to_json

Function write_to_json

demo_utils/utils.py:108–113  ·  view source on GitHub ↗
(data, file_path)

Source from the content-addressed store, hash-verified

106
107
108def write_to_json(data, file_path):
109 temp_file_path = file_path + ".tmp"
110 with open(temp_file_path, 'wt', encoding='utf-8') as temp_file:
111 json.dump(data, temp_file, indent=4)
112 os.replace(temp_file_path, file_path)
113 return
114
115
116def read_from_json(file_path):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected