Open the file, unpickle one object from it using :mod:`pickle`, and return
        it.
351185
def read_pickle (self):
        
        gen = self.read_pickles ()
        value = gen.next ()
        gen.close ()
        return value
1164737
def load(cls, filepath):
        
        with open(filepath, "rb") as filehandler:
            classifier = pickle.load(filehandler)

        if not isinstance(classifier, Classifier):
            raise ValueError("Pickled object is not a Classifier")

        return classifier
499169
def to_pickle(self, filename):
        """"""
        with open(filename, 'wb') as f:
            pickle.dump(self, f)
1339254
def load(filename):
    
    filename = os.path.normcase(filename)
    try:
        with open(filename, 'rb') as f:
            u = pickle.Unpickler(f)
            return u.load()
    except IOError:
        raise LogOpeningError('No file found for %s' % filename, filename)
381948
def _pickle_load(path):
        
        _, ext = os.path.splitext(path)
        topology = None
        if sys.version_info.major == 2:
            if ext == '.pickle2':
                with open(path, 'rb') as f:
                    topology = pickle.load(f)
            elif ext in ('.pickle3', '.pickle'):
                with open(path, 'rb') as f:
                    topology = pickle.load(f, protocol=3)
        elif sys.version_info.major == 3:
            if ext == '.pickle2':
                with open(path, 'rb') as f:
                    topology = pickle.load(f)
            elif ext in ('.pickle3', '.pickle'):
                with open(path, 'rb') as f:
                    topology = pickle.load(f)
        if topology is None:
            raise ValueError('File {} is not compatible with this version'.format(path))
        return topology
1034522
def dump(self, dump_filename, pickle_protocol=pickle.HIGHEST_PROTOCOL):
        
        result = self.result()

        with open(dump_filename, 'wb') as f:
            pickle.dump((self.__class__, result), f, pickle_protocol)
444527
function pickFile(rootFolder, fileName) {
    var result = path.join(rootFolder, fileName);
    if (fs.existsSync(result)) {
        return result;
    }

    return undefined;
}
880178
def cloudpickle_dumps(obj, dumper=cloudpickle.dumps):
    
    return dumper(obj, protocol=serialization.pickle_protocol)
630512
def save_pickle(obj, outfile, protocol=2):
    
    with open(outfile, 'wb') as f:
        pickle.dump(obj, f, protocol=protocol)

    return outfile
154944
def load(path):
    
    f = open(path, 'rb')
    try:
        return pickle.load(f)
    finally:
        f.close()
81137
def load(root_file, use_proxy=True, key=None):
    
    if isinstance(root_file, string_types):
        root_file = root_open(root_file)
        own_file = True
    else:
        own_file = False
    obj = Unpickler(root_file, use_proxy).load(key)
    if own_file:
        root_file.Close()
    return obj
436786
def pickle(self) -> None:
        

        pickle_path = self.tgt_dir / "corpus.p"
        logger.debug("pickling %r object and saving it to path %s", self, pickle_path)
        with pickle_path.open("wb") as f:
            pickle.dump(self, f)
420336
def pickle(self, f, protocol=-1):
        
        try: #Py2
            import cPickle as pickle
            if isinstance(f, basestring):
                with open(f, 'wb') as f:
                    pickle.dump(self, f, protocol)
            else:
                pickle.dump(self, f, protocol)
        except ImportError: #python3
            import pickle
            if isinstance(f, str):
                with open(f, 'wb') as f:
                    pickle.dump(self, f, protocol)
            else:
                pickle.dump(self, f, protocol)
631662
def load(cls, path):
        ""
        itos = pickle.load(open(path, 'rb'))
        return cls(itos)
519877
def load(self, filename='classifier.dump'):
        
        ifile = open(filename, 'r+')
        self.classifier = pickle.load(ifile)
        ifile.close()
746365
def _open(file_, mode='r'):
  """"""
  if isinstance(file_, string_types):
    _, ext = path.splitext(file_)
    if ext in {'.bz2', '.gz'}:
      s = tarfile.open(file_)
      return s.extractfile(s.next())
    else:
      return open(file_, mode)
  return file_
1247155
def _get_next_obj(self, length):
        """"""
        data = b''
        while len(data) < length:
            data += self.sock.recv(length - len(data))

        return pickle.loads(data)