예제 #1
0
    def __init__(self, file, protocol=None):
        Pickler.__init__(self, file, protocol)
        self.lazywrites = deque()
        self.realwrite = file.write

        # Pickler.__init__ overwrites self.write, we do not want that
        del self.write
예제 #2
0
파일: pool.py 프로젝트: 93sam/scikit-learn
 def __init__(self, writer, reducers=None, protocol=HIGHEST_PROTOCOL):
     _Pickler.__init__(self, writer, protocol=protocol)
     # Make the dispatch registry an instance level attribute instead of a
     # reference to the class dictionary
     self.dispatch = _Pickler.dispatch.copy()
     for type, reduce_func in reducers.items():
         self.register(type, reduce_func)
예제 #3
0
    def __init__(self, protocol):
        # You may want to replace this with a fake file object that just
        # discards writes.
        blackhole = open(os.devnull, 'w')

        Pickler.__init__(self, blackhole, protocol)
        self.depth = 0
예제 #4
0
 def __init__(self, writer, reducers=None, protocol=HIGHEST_PROTOCOL):
     _Pickler.__init__(self, writer, protocol=protocol)
     # Make the dispatch registry an instance level attribute instead of a
     # reference to the class dictionary
     self.dispatch = _Pickler.dispatch.copy()
     for type, reduce_func in reducers.items():
         self.register(type, reduce_func)
예제 #5
0
 def __init__(self, file, protocol=None):
     Pickler.__init__(self, file, protocol)
     # set of modules to unpickle
     self.modules = set()
     # map ids to dictionary. used to ensure that functions can share
     # global env
     self.globals_ref = {}
예제 #6
0
파일: cloudpickle.py 프로젝트: adgirish/ray
 def __init__(self, file, protocol=None):
     if protocol is None:
         protocol = DEFAULT_PROTOCOL
     Pickler.__init__(self, file, protocol=protocol)
     # set of modules to unpickle
     self.modules = set()
     # map ids to dictionary. used to ensure that functions can share global env
     self.globals_ref = {}
예제 #7
0
 def __init__(self, file, protocol=None):
     if protocol is None:
         protocol = DEFAULT_PROTOCOL
     Pickler.__init__(self, file, protocol=protocol)
     # set of modules to unpickle
     self.modules = set()
     # map ids to dictionary. used to ensure that functions can share global env
     self.globals_ref = {}
예제 #8
0
파일: pool.py 프로젝트: Salmista-94/joblib
 def __init__(self, writer, reducers=None, protocol=HIGHEST_PROTOCOL):
     Pickler.__init__(self, writer, protocol=protocol)
     if reducers is None:
         reducers = {}
     if hasattr(Pickler, 'dispatch'):
         # Make the dispatch registry an instance level attribute instead of
         # a reference to the class dictionary under Python 2
         self.dispatch = Pickler.dispatch.copy()
     else:
         # Under Python 3 initialize the dispatch table with a copy of the
         # default registry
         self.dispatch_table = copyreg.dispatch_table.copy()
     for type, reduce_func in reducers.items():
         self.register(type, reduce_func)
예제 #9
0
 def __init__(self, writer, reducers=None, protocol=HIGHEST_PROTOCOL):
     Pickler.__init__(self, writer, protocol=protocol)
     if reducers is None:
         reducers = {}
     if hasattr(Pickler, 'dispatch'):
         # Make the dispatch registry an instance level attribute instead of
         # a reference to the class dictionary under Python 2
         self.dispatch = Pickler.dispatch.copy()
     else:
         # Under Python 3 initialize the dispatch table with a copy of the
         # default registry
         self.dispatch_table = copyreg.dispatch_table.copy()
     for type, reduce_func in reducers.items():
         self.register(type, reduce_func)
예제 #10
0
 def __init__(self, *args, **kargs):
     Pickler.__init__(self, *args, **kargs)
     self.stack = []
예제 #11
0
 def __init__(self, writer, protocol=HIGHEST_PROTOCOL):
     Pickler.__init__(self, writer, protocol=protocol)
예제 #12
0
파일: spickle.py 프로젝트: fspaolo/code
 def __init__(self, file, protocol, bin=None):
     Pickler.__init__(self, file, protocol)
     self.bin = bin
예제 #13
0
 def __init__(self, file, protocol, uneven):
     Pickler.__init__(self, file, protocol)
     self.uneven = uneven
예제 #14
0
 def __init__(self, file, protocol, bin=None):
     Pickler.__init__(self, file, protocol)
     self.bin = bin
예제 #15
0
파일: mypickle.py 프로젝트: enyst/plexnet
 def __init__(self, file, protocol, uneven):
     Pickler.__init__(self, file, protocol)
     self.uneven = uneven
예제 #16
0
 def __init__(self, *args, **kwargs):
     Pickler.__init__(self, *args, **kwargs)
     self.dispatch_table = dispatch_table.copy()
     self.dispatch_table.update(self._extra_reducers)
예제 #17
0
 def __init__(self, *args, **kwargs):
     Pickler.__init__(self, *args, **kwargs)
     self.dispatch_table = dispatch_table.copy()
     self.dispatch_table.update(self._extra_reducers)
예제 #18
0
 def __init__(self, *args, **kargs):
     Pickler.__init__(self, *args, **kargs)
     self.stack = []