MCPcopy Create free account
hub / github.com/BIT-DataLab/LakeBench / saveDictionaryAsPickleFile

Function saveDictionaryAsPickleFile

union/TUS/generalFunctions.py:108–115  ·  view source on GitHub ↗
(dictionary, dictionaryPath)

Source from the content-addressed store, hash-verified

106
107#This function saves dictionaries as pickle files in the storage.
108def saveDictionaryAsPickleFile(dictionary, dictionaryPath):
109 if dictionaryPath.rsplit(".")[-1] == "pickle":
110 filePointer=open(dictionaryPath, 'wb')
111 pickle.dump(dictionary,filePointer, protocol=pickle.HIGHEST_PROTOCOL)
112 filePointer.close()
113 else:
114 with bz2.BZ2File(dictionaryPath, "w") as f:
115 cPickle.dump(dictionary, f)
116
117
118#load the pickle file as a dictionary

Callers

nothing calls this directly

Calls 1

closeMethod · 0.80

Tested by

no test coverage detected