MCPcopy Create free account
hub / github.com/ActiveState/code / loads

Method loads

recipes/Python/576980_Authenticated/recipe-576980.py:64–69  ·  view source on GitHub ↗

decrypt and unpickle a python object

(self, data, pickler=pickle)

Source from the content-addressed store, hash-verified

62 return self.encrypt(self.PICKLE_PAD + pickler.dumps(obj))
63
64 def loads(self, data, pickler=pickle):
65 """decrypt and unpickle a python object"""
66 data = self.decrypt(data)
67 # simple integrity check to verify that we got meaningful data
68 assert data.startswith(self.PICKLE_PAD), "unexpected header"
69 return pickler.loads(data[len(self.PICKLE_PAD):])
70
71
72if __name__ == "__main__":

Callers 15

_get_from_gplusMethod · 0.45
recipe-502237.pyFile · 0.45
processFunction · 0.45
recipe-335817.pyFile · 0.45
__init__Method · 0.45
readMethod · 0.45
recipe-578674.pyFile · 0.45
loadFunction · 0.45
xml2dictFunction · 0.45
loadMethod · 0.45
__getitem__Method · 0.45

Calls 2

decryptMethod · 0.95
startswithMethod · 0.80

Tested by

no test coverage detected