class_docstr: A pickler to persist big data efficiently.
  
  The main features of this object are:
  * persistence of numpy arrays in a single file.
  * optional compression with a special care on avoiding memory copies.
  
  Attributes
  ----------
  fp: file
      File object handle used for serializing the input object.
  protocol: int
      Pickle protocol used. Default is pickle.DEFAULT_PROTOCOL under
      python 3, pickle.HIGHEST_PROTOCOL otherwise.
class_docstr_tok: ["A","pickler","to","persist","big","data","efficiently",".","The","main","features","of","this","object","are",":","*","persistence","of","numpy","arrays","in","a","single","file",".","*","optional","compression","with","a","special","care","on","avoiding","memory","copies",".","Attributes","--","--","--","--","--","fp",":","file","File","object","handle","used","for","serializing","the","input","object",".","protocol",":","int","Pickle","protocol","used",".","Default","is","pickle.DEFAULT_PROTOCOL","under","python","3",",","pickle.HIGHEST_PROTOCOL","otherwise","."]
docstr: Subclass the Pickler `save` method.
  
  This is a total abuse of the Pickler class in order to use the numpy
  persistence function `save` instead of the default pickle
  implementation. The numpy array is replaced by a custom wrapper in the
  pickle persistence stack and the serialized array is written right
  after in the file. Warning: the file produced does not follow the
  pickle format. As such it can not be read with `pickle.load`.
docstr_tok: ["Subclass","the","Pickler","`","save","`","method",".","This","is","a","total","abuse","of","the","Pickler","class","in","order","to","use","the","numpy","persistence","function","`","save","`","instead","of","the","default","pickle","implementation",".","The","numpy","array","is","replaced","by","a","custom","wrapper","in","the","pickle","persistence","stack","and","the","serialized","array","is","written","right","after","in","the","file",".","Warning",":","the","file","produced","does","not","follow","the","pickle","format",".","As","such","it","can","not","be","read","with","`","pickle.load","`","."]
code: def save(self, obj):
      """Subclass the Pickler `save` method.
  
      This is a total abuse of the Pickler class in order to use the numpy
      persistence function `save` instead of the default pickle
      implementation. The numpy array is replaced by a custom wrapper in the
      pickle persistence stack and the serialized array is written right
      after in the file. Warning: the file produced does not follow the
      pickle format. As such it can not be read with `pickle.load`.
      """
      if self.np is not None and type(obj) in (
          self.np.ndarray,
          self.np.matrix,
          self.np.memmap,
      ):
          if type(obj) is self.np.memmap:
              # Pickling doesn't work with memmapped arrays
              obj = self.np.asanyarray(obj)
  
          # The array wrapper is pickled instead of the real array.
          wrapper = self._create_array_wrapper(obj)
          Pickler.save(self, wrapper)
  
          # A framer was introduced with pickle protocol 4 and we want to
          # ensure the wrapper object is written before the numpy array
          # buffer in the pickle file.
          # See https://www.python.org/dev/peps/pep-3154/#framing to get
          # more information on the framer behavior.
          if self.proto >= 4:
              self.framer.commit_frame(force=True)
  
          # And then array bytes are written right after the wrapper.
          wrapper.write_array(obj, self)
          return
  
      return Pickler.save(self, obj)
  
imports: import pickle
  import os
  import sys
  import warnings
  from .numpy_pickle_utils import _COMPRESSORS
  from .numpy_pickle_utils import BinaryZlibFile
  from .numpy_pickle_utils import Unpickler, Pickler
  from .numpy_pickle_utils import _read_fileobject, _write_fileobject
  from .numpy_pickle_utils import _read_bytes, BUFFER_SIZE
  from .numpy_pickle_compat import load_compatibility
  from .numpy_pickle_compat import NDArrayWrapper
  from .numpy_pickle_compat import ZNDArrayWrapper
  from ._compat import _basestring, PY3_OR_LATER
label_desc: Use image node_id 3 for calling the NumpyPickler obj's underlying member method code with example usage: obj.save(obj) and returns: Pickler