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
예제 #2
0
 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
예제 #3
0
파일: numpy_pickle.py 프로젝트: zjwang6/TS
 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
예제 #4
0
 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
예제 #5
0
 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
예제 #6
0
 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
예제 #7
0
파일: dill.py 프로젝트: brstrat/dill
 def __init__(self, *args, **kwds):
     StockUnpickler.__init__(self, *args, **kwds)
     self._main = _main_module
예제 #8
0
 def __init__(self, *args, **kwargs):
     StockUnpickler.__init__(self, *args, **kwargs)
     self._main_module = _main_module
예제 #9
0
 def __init__(self, file, updater=None):
     Unpickler.__init__(self, file)
     self.updater = updater
예제 #10
0
 def __init__(self, file):
     _Unpickler.__init__(self, file)
     self.file = file
     self.dispatch[NUMPY_NDARRAY_OPCODE[0]] = Unpickler.load_numpy_ndarray
예제 #11
0
파일: dill.py 프로젝트: wxiang7/dill
 def __init__(self, *args, **kwds):
     StockUnpickler.__init__(self, *args, **kwds)
     from collections import defaultdict
     self._main = _main_module
     self._func_globals = defaultdict(list)