MCPcopy Create free account
hub / github.com/OpenDriveLab/DriveAdapter / save_dict

Function save_dict

leaderboard/leaderboard/utils/checkpoint_tools.py:67–77  ·  view source on GitHub ↗
(endpoint, data)

Source from the content-addressed store, hash-verified

65
66
67def save_dict(endpoint, data):
68 if endpoint.startswith(('http:', 'https:', 'ftp:')):
69 proxies = autodetect_proxy()
70
71 if proxies:
72 _ = requests.patch(url=endpoint, headers={'content-type':'application/json'}, data=json.dumps(data, indent=4, sort_keys=True), proxies=proxies)
73 else:
74 _ = requests.patch(url=endpoint, headers={'content-type':'application/json'}, data=json.dumps(data, indent=4, sort_keys=True))
75 else:
76 with open(endpoint, 'w') as fd:
77 json.dump(data, fd, indent=4, sort_keys=True)

Callers 5

save_recordMethod · 0.90
save_global_recordMethod · 0.90
save_sensorsMethod · 0.90
save_entry_statusMethod · 0.90
save_stateMethod · 0.90

Calls 1

autodetect_proxyFunction · 0.85

Tested by

no test coverage detected