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

All Samples(1955)  |  Call(1794)  |  Derive(0)  |  Import(161)
load(file) -- Load a pickle from the given file

src/p/y/pymol-HEAD/trunk/pymol/examples/devel/syncmol.py   pymol(Download)
        cPickle.dump(args,self.send,1)
        cPickle.dump(kwds,self.send,1)
        self.send.flush()
        result = cPickle.load(self.recv)
        return result
 
def remote_set_view(view,_self=cmd):
     def handle(self):
         while self.server.keep_alive:
             # get method name from client
 
             try:
                 method = cPickle.load(self.rfile)
             except EOFError,socket.error:
                 break
 
             if method == 'shutdown':
                 self.server.keep_alive = 0
 
             # get arguments from client
             args = cPickle.load(self.rfile)
 
             # get arguments from client
             args = cPickle.load(self.rfile)
             kw = cPickle.load(self.rfile)
 
             # get cmd method pointer
             meth_obj = getattr(self.server.cmd,method)

src/p/y/pymol-HEAD/pymol/examples/devel/syncmol.py   pymol(Download)
        cPickle.dump(args,self.send,1)
        cPickle.dump(kwds,self.send,1)
        self.send.flush()
        result = cPickle.load(self.recv)
        return result
 
def remote_set_view(view,_self=cmd):
     def handle(self):
         while self.server.keep_alive:
             # get method name from client
 
             try:
                 method = cPickle.load(self.rfile)
             except EOFError,socket.error:
                 break
 
             if method == 'shutdown':
                 self.server.keep_alive = 0
 
             # get arguments from client
             args = cPickle.load(self.rfile)
 
             # get arguments from client
             args = cPickle.load(self.rfile)
             kw = cPickle.load(self.rfile)
 
             # get cmd method pointer
             meth_obj = getattr(self.server.cmd,method)

src/g/o/google-app-engine-HEAD/lib/webob/docs/comment-example-code/example.py   google-app-engine(Download)
import os
import urllib
import time
import re
from cPickle import load, dump
from webob import Request, Response, html_escape
from webob import exc
            return []
        else:
            f = open(filename, 'rb')
            data = load(f)
            f.close()
            return data
 

src/g/o/google_appengine-HEAD/lib/webob/docs/comment-example-code/example.py   google_appengine(Download)
import os
import urllib
import time
import re
from cPickle import load, dump
from webob import Request, Response, html_escape
from webob import exc
            return []
        else:
            f = open(filename, 'rb')
            data = load(f)
            f.close()
            return data
 

src/m/a/matplotlib-HEAD/toolkits/basemap-0.9.6.1/examples/ireland.py   matplotlib(Download)
clf()
# read cPickle back in and plot it again (should be much faster).
t1 = time.clock()
m2 = cPickle.load(open('map.pickle','rb'))
print time.clock()-t1,' to read the intermediate res coastline class instance back in from a cPickle'
# draw coastlines and fill continents.
m2.drawcoastlines()
clf()
# read cPickle back in and plot it again (should be much faster).
t1 = time.clock()
m2 = cPickle.load(open('map.pickle','rb'))
print time.clock()-t1,' to read the high res coastline class instance back in from a cPickle'
# draw coastlines and fill continents.
m2.drawcoastlines()

src/n/e/Nevow-0.10.0/examples/pastebin/pastebin/service.py   Nevow(Download)
    def _loadPastingData(self, oid):
        f = file(self._makeFilename(str(oid)), 'rb')
        return pickle.load(f)
 
    def _savePastingData(self, oid, data):
        f = file(self._makeFilename(str(oid)), 'wb')
        pickle.dump(data, f, pickle.HIGHEST_PROTOCOL)
    def startService(self):
        log.msg('Loading index')
        try:
            f = file(self._makeFilename('index'), 'rb')
            d = pickle.load(f)
            self._index = d['index']
            self._nextOid = d['nextOid']

src/c/u/CUV-HEAD/examples/rbm/base.py   CUV(Download)
    def loadOptions(self,layer=0,postfix=""):
        fn= os.path.join(self.cfg.workdir,"info-%s%s.pickle"%(layer,postfix))
        # load pickle with statistics
        if os.path.exists(fn):
            with open(fn,"r") as f:
                return cPickle.load(f)
        return None
 
    def saveOptions(self,optionDict,layer=0,postfix=""):
        fn= os.path.join(self.cfg.workdir,"info-%s%s.pickle"%(layer,postfix))
        # load pickle with statistics
        if os.path.exists(fn):
            with open(fn,"r") as f:
                options=cPickle.load(f)

src/g/a/gaesdk-python-HEAD/lib/webob/docs/comment-example-code/example.py   gaesdk-python(Download)
import os
import urllib
import time
import re
from cPickle import load, dump
from webob import Request, Response, html_escape
from webob import exc
            return []
        else:
            f = open(filename, 'rb')
            data = load(f)
            f.close()
            return data
 

src/c/u/CUV-HEAD/examples/rbm/analyse/calc_part_func.py   CUV(Download)
    fn = os.path.join(cfg.basename, "info-0-%s.pickle"%cfg.idx)
    if not cfg.overwrite and os.path.exists(fn):
        with open(fn, "r") as f:
            stats = cPickle.load(f)
            if "nats" in stats:
                print "pickle already has a value for partition function in it, exiting."
                sys.exit(0)
    cp.initCUDA(cfg.device)
 
    #load pickle with rbm cfg
    fn = os.path.join(cfg.basename, "info-0.pickle")
    with open(fn,"r") as f:
        rbmcfg=cPickle.load(f)
    fn = os.path.join(cfg.basename, "info-0-%s.pickle"%cfg.idx)
    if os.path.exists(fn):
        with open(fn, "r") as f:
            stats = cPickle.load(f)
    else:
        stats = {}
 

src/m/a/matplotlib-HEAD/toolkits/basemap/examples/hires.py   matplotlib(Download)
plt.clf()
# read cPickle back in and plot it again (should be much faster).
t1 = time.clock()
m2 = cPickle.load(open('map.pickle','rb'))
# draw coastlines and fill continents.
m.drawcoastlines()
# fill continents and lakes

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