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

Function loadDictionaryFromPickleFile

union/Santos/generalFunctions.py:119–129  ·  view source on GitHub ↗
(dictionaryPath)

Source from the content-addressed store, hash-verified

117
118#load the pickle file as a dictionary
119def loadDictionaryFromPickleFile(dictionaryPath):
120 print("Loading dictionary at:", dictionaryPath)
121 if dictionaryPath.rsplit(".")[-1] == "pickle":
122 filePointer=open(dictionaryPath, 'rb')
123 dictionary = pickle.load(filePointer)
124 filePointer.close()
125 else:
126 dictionary = bz2.BZ2File(dictionaryPath, "rb")
127 dictionary = cPickle.load(dictionary)
128 print("The total number of keys in the dictionary are:", len(dictionary))
129 return dictionary
130
131
132#load csv file as a dictionary. Further preprocessing may be required after loading

Callers

nothing calls this directly

Calls 1

closeMethod · 0.80

Tested by

no test coverage detected