• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(2712)  |  Call(2483)  |  Derive(0)  |  Import(229)
dumps(obj, protocol=0) -- Return a string containing an object in pickle format.

See the Pickler docstring for the meaning of optional argument proto.

src/n/o/notmm-0.4.1/examples/lib/keyedcache/__init__.py   notmm(Download)
def md5_hash(obj):
    pickled = pickle.dumps(obj, protocol=pickle.HIGHEST_PROTOCOL)
    return md5_constructor(pickled).hexdigest()
 
 
def is_memcached_backend():
    try:

src/p/r/protocyt-HEAD/protocyt/examples/benchmark/main.py   protocyt(Download)
        def test_dumps():
            pickle.dumps(tree, 2)
 
        def test_loads(data):
            pickle.loads(data)
 
 
        ba = bytearray()
        tree.serialize(ba)
        data = pickle.dumps(tree, 2)
        def test_dumps():
            return len(pickle.dumps(tree, 2))
 
        result = test_serialize()
        print 'serialize', result
        yield 'serialize', result
        result = test_dumps()

src/p/r/protocyt-0.1/protocyt/examples/benchmark/main.py   protocyt(Download)
        def test_dumps():
            pickle.dumps(tree, 2)
 
        def test_loads(data):
            pickle.loads(data)
 
 
        ba = bytearray()
        tree.serialize(ba)
        data = pickle.dumps(tree, 2)
        def test_dumps():
            return len(pickle.dumps(tree, 2))
 
        result = test_serialize()
        print 'serialize', result
        yield 'serialize', result
        result = test_dumps()

src/p/y/python-cookbook-HEAD/cb2_examples/cb2_7_12_sol_1.py   python-cookbook(Download)
for name in names:
    datum = list(name)
    datum.sort()
    data[name] = cPickle.dumps(datum, 2)
# Perform the insertions
sql = 'INSERT INTO justatest VALUES(%s, %s)'
for name in names:

src/p/y/python-cookbook-HEAD/cb2_examples/cb2_7_11_sol_1.py   python-cookbook(Download)
    for name in names:
        datum = list(name)
        datum.sort()
        data[name] = cPickle.dumps(datum, 2)
    # Perform the insertions
    sql = "INSERT INTO justatest VALUES(%s, %s)"
    for name in names:

src/p/y/python-cookbook-HEAD/cb2_examples/cb2_7_10_sol_1.py   python-cookbook(Download)
    for name in names:
        datum = list(name)
        datum.sort()
        data[name] = cPickle.dumps(datum, 2)
    # Perform the insertions
    sql = "INSERT INTO justatest VALUES(%s, %s)"
    for name in names:

src/f/l/flocking-HEAD/flocking/measure/sampler.py   flocking(Download)
                    'CompactAdjacencyMatrix().compute(flock, ' +
                    flockstep.neighbor_selector.c_init() + ', (unsigned char *)matrix);'])
            c_code.CProgram(vars, code, headers, openmp = False).run()
            return zlib.compress(pickle.dumps(matrix, 2))
        else:
            raise 'No pure python version'
 

src/d/j/django-navbar-0.3.0/examples/dbgp/_logging/handlers.py   django-navbar(Download)
        if ei:
            dummy = self.format(record) # just to get traceback text into record.exc_text
            record.exc_info = None  # to avoid Unpickleable error
        s = cPickle.dumps(record.__dict__, 1)
        if ei:
            record.exc_info = ei  # for next handler
        slen = struct.pack(">L", len(s))

src/m/o/mocop-HEAD/trunk/tools/samplejsonrpcclient.py   mocop(Download)
sessionID = s.login("domain1", "user1", "pass11")
print 'Connected. SessionID:', type(sessionID)
 
prm = base64.encodestring(zlib.compress(cPickle.dumps(('JSON_RPC CLIENT WORKS',), )))
kw = base64.encodestring(zlib.compress(cPickle.dumps({}, )))
result = s.run(sessionID, "base.controllers.test.Test:cik", prm, kw)
print 'Result:', cPickle.loads(zlib.decompress(base64.decodestring(result)))

src/m/o/mocop-HEAD/tools/samplejsonrpcclient.py   mocop(Download)
sessionID = s.login("domain1", "user1", "pass11")
print 'Connected. SessionID:', type(sessionID)
 
prm = base64.encodestring(zlib.compress(cPickle.dumps(('JSON_RPC CLIENT WORKS',), )))
kw = base64.encodestring(zlib.compress(cPickle.dumps({}, )))
result = s.run(sessionID, "base.controllers.test.Test:cik", prm, kw)
print 'Result:', cPickle.loads(zlib.decompress(base64.decodestring(result)))

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next