Module Expr Str Import alias Import alias TryExcept body ImportFrom alias handlers ExceptHandler body ImportFrom alias FunctionDef arguments args NameParam defaults body Return Call NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Return Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list TryExcept body Import alias Import alias identifier handlers ExceptHandler type NameLoad body Pass Assign NameStore DictComp AttributeLoad AttributeLoad Call NameLoad Num attr attr NameLoad comprehension NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults NameLoad body If CompareIs NameLoad NameLoad body Return Str Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If CompareEq NameLoad Str body Return BinOpAdd Str Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad BinOpAdd NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body If CompareEq Call NameLoad NameLoad Num body Return NameLoad If CompareEq SubscriptLoad NameLoad Index Num Str body Return Call AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num attr NameLoad Assign NameStore SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num keyword NameLoad If CompareEq SubscriptLoad NameLoad Index Num Str body Expr Call AttributeLoad NameLoad attr keyword NameLoad Return NameLoad decorator_list If CompareEq NameLoad Str body Import alias Print Call AttributeLoad NameLoad attr
N/A N/A 
>>> a = np.arange(20)
>>> (a == snappy_unpack_blob(snappy_pack_blob(a))).all()
True

>>> a = np.arange(20, dtype=np.uint8)
>>> snappy_unpack_blob(snappy_pack_blob(a)).dtype == a.dtype
True

>>> a = np.arange(20, dtype=np.float32)
>>> b = snappy_unpack_blob(snappy_pack_blob(a))
>>> a.dtype == b.dtype == np.float32
True

>>> all(ai == bi for ai, bi in zip(a, b))
True

>>> snappy_unpack_blob(snappy_pack_blob(None)) is None
True

>>> exp = ['A', 'XSDFSDFSD', "A/A,B"]
>>> obs = snappy_unpack_blob(snappy_pack_blob(np.array(exp)))
>>> assert exp == list(obs)

>>> try:
...    b = snappy_pack_blob(a)
... except zlib.error:
...    pass


>>> b = snappy_unpack_blob(snappy_pack_blob(np.array([False, True, False, True])))
>>> b[2] = True
 N/A zlib N/A cPickle N/A N/A cyordereddict OrderedDict N/A N/A N/A collections OrderedDict pack_blob N/A N/A obj N/A N/A N/A N/A buffer N/A zdumps obj N/A unpack_genotype_blob N/A N/A blob N/A N/A N/A N/A N/A cPickle loads N/A N/A zlib decompress blob N/A unpack_ordereddict_blob N/A N/A blob N/A N/A N/A blob_val N/A N/A cPickle loads N/A N/A zlib decompress blob N/A N/A blob_val None N/A N/A N/A OrderedDict blob_val N/A None N/A zdumps N/A N/A obj N/A N/A N/A N/A N/A zlib compress N/A N/A cPickle dumps obj N/A cPickle HIGHEST_PROTOCOL 9 N/A zloads N/A N/A obj N/A N/A N/A N/A N/A cPickle loads N/A N/A zlib decompress obj N/A N/A N/A N/A snappy N/A numpy np N/A N/A N/A ImportError N/A N/A N/A lookup N/A N/A N/A N/A dt 1 dtype char dt N/A dt N/A N/A np uint8 N/A np uint32 N/A np int32 N/A np float32 N/A np int64 N/A np float64 N/A np bool_ N/A SEP snappy_pack_blob N/A N/A obj sep N/A SEP N/A N/A N/A obj None N/A N/A N/A c N/A N/A obj dtype char N/A N/A c S N/A N/A N/A S N/A N/A snappy compress N/A N/A sep join obj N/A N/A buffer N/A c N/A N/A snappy compress N/A N/A obj tobytes N/A snappy_unpack_blob N/A N/A blob sep N/A SEP N/A N/A N/A N/A len blob 0 N/A N/A None N/A N/A N/A blob N/A 0 S N/A N/A N/A N/A np array N/A N/A N/A N/A snappy decompress N/A blob N/A 1 split sep N/A dt N/A lookup N/A N/A blob N/A 0 N/A arr N/A N/A np frombuffer N/A N/A snappy decompress N/A blob N/A 1 dtype dt N/A N/A N/A blob N/A 0 ? N/A N/A N/A N/A arr setflags write True N/A arr N/A N/A N/A __name__ __main__ N/A N/A doctest N/A N/A N/A doctest testmod