def dumps(C): m = module_husky.loads(C.__module__) if not module_husky.is_userdefined(m): return wrap.dumps((TYPE_NON_USERDEFINED, C.__name__, m)) else: dicts = {k: v for k, v in vars(C).iteritems() if k not in ignores} return wrap.dumps((TYPE_USERDEFINED, C.__name__, C.__bases__, dicts))
def dumps(f, gen_globals=True): code = marshal.dumps(f.func_code) if f.func_closure: closure = [c.cell_contents for c in f.func_closure] else: closure = None if gen_globals: g = find_requires(f) else: g = {} return wrap.dumps((code, g, closure, f.func_defaults), False)
def dumps(ins): d = getattr(ins, "__dict__", None) return wrap.dumps((ins.__class__, d))
def dumps(t): if t in type_list: return wrap.dumps(type_list.index(t)) else: return class_husky.dumps(t)
def dumps(variable, gen_globals=True): return pickle.dumps({wrap.dumps(k, gen_globals): wrap.dumps(v, gen_globals) for k, v in variable.iteritems()})
def dumps(variable, gen_globals=True): return pickle.dumps([wrap.dumps(item, gen_globals) for item in variable])