def __init__(self, filename, mmap_mode=None): self._filename = filename self.mmap_mode = mmap_mode self._dirname = os.path.dirname(filename) self.file = open(filename, 'rb') Unpickler.__init__(self, self.file) import numpy as np self.np = np
def __init__(self, filename, file_handle, mmap_mode=None): self._filename = os.path.basename(filename) self._dirname = os.path.dirname(filename) self.mmap_mode = mmap_mode self.file_handle = self._open_pickle(file_handle) Unpickler.__init__(self, self.file_handle) try: import numpy as np except ImportError: np = None self.np = np
def __init__(self, filename, file_handle=None, mmap_mode=None): self._filename = os.path.basename(filename) self.mmap_mode = mmap_mode self._dirname = os.path.dirname(filename) if file_handle is None: file_handle = self._open_file(self._filename) if isinstance(file_handle, basestring): # To handle memmap, we need to have file names file_handle = open(file_handle, 'rb') self.file_handle = file_handle Unpickler.__init__(self, self.file_handle) try: import numpy as np except ImportError: np = None self.np = np
def __init__(self, *args, **kwds): StockUnpickler.__init__(self, *args, **kwds) self._main = _main_module
def __init__(self, *args, **kwargs): StockUnpickler.__init__(self, *args, **kwargs) self._main_module = _main_module
def __init__(self, file, updater=None): Unpickler.__init__(self, file) self.updater = updater
def __init__(self, file): _Unpickler.__init__(self, file) self.file = file self.dispatch[NUMPY_NDARRAY_OPCODE[0]] = Unpickler.load_numpy_ndarray
def __init__(self, *args, **kwds): StockUnpickler.__init__(self, *args, **kwds) from collections import defaultdict self._main = _main_module self._func_globals = defaultdict(list)