class_docstr: An object to be persisted instead of numpy arrays.
  
  This object is used to hack into the pickle machinery and read numpy
  array data from our custom persistence format.
  More precisely, this object is used for:
  * carrying the information of the persisted array: subclass, shape, order,
  dtype. Those ndarray metadata are used to correctly reconstruct the array
  with low level numpy functions.
  * determining if memmap is allowed on the array.
  * reading the array bytes from a file.
  * reading the array using memorymap from a file.
  * writing the array bytes to a file.
  
  Attributes
  ----------
  subclass: numpy.ndarray subclass
      Determine the subclass of the wrapped array.
  shape: numpy.ndarray shape
      Determine the shape of the wrapped array.
  order: {'C', 'F'}
      Determine the order of wrapped array data. 'C' is for C order, 'F' is
      for fortran order.
  dtype: numpy.ndarray dtype
      Determine the data type of the wrapped array.
  allow_mmap: bool
      Determine if memory mapping is allowed on the wrapped array.
      Default: False.
docstr: Write array bytes to pickler file handle.
  
  This function is an adaptation of the numpy write_array function
  available in version 1.10.1 in numpy/lib/format.py.
docstr_tok: ["Write","array","bytes","to","pickler","file","handle",".","This","function","is","an","adaptation","of","the","numpy","write_array","function","available","in","version","1.10.1","in","numpy\/lib\/format.py","."]
code: def write_array(self, array, pickler):
      """Write array bytes to pickler file handle.
  
      This function is an adaptation of the numpy write_array function
      available in version 1.10.1 in numpy/lib/format.py.
      """
      # Set buffer size to 16 MiB to hide the Python loop overhead.
      buffersize = max(16 * 1024**2 // array.itemsize, 1)
      if array.dtype.hasobject:
          # We contain Python objects so we cannot write out the data
          # directly. Instead, we will pickle it out with version 2 of the
          # pickle protocol.
          pickle.dump(array, pickler.file_handle, protocol=2)
      else:
          numpy_array_alignment_bytes = (
              self.safe_get_numpy_array_alignment_bytes()
          )
          if numpy_array_alignment_bytes is not None:
              current_pos = pickler.file_handle.tell()
              pos_after_padding_byte = current_pos + 1
              padding_length = numpy_array_alignment_bytes - (
                  pos_after_padding_byte % numpy_array_alignment_bytes
              )
              # A single byte is written that contains the padding length in
              # bytes
              padding_length_byte = int.to_bytes(
                  padding_length, length=1, byteorder="little"
              )
              pickler.file_handle.write(padding_length_byte)
  
              if padding_length != 0:
                  padding = b"\xff" * padding_length
                  pickler.file_handle.write(padding)
  
          for chunk in pickler.np.nditer(
              array,
              flags=["external_loop", "buffered", "zerosize_ok"],
              buffersize=buffersize,
              order=self.order,
          ):
              pickler.file_handle.write(chunk.tobytes("C"))
  
imports: import pickle
  import os
  import warnings
  import io
  from pathlib import Path
  from .compressor import lz4, LZ4_NOT_INSTALLED_ERROR
  from .compressor import _COMPRESSORS, register_compressor, BinaryZlibFile
  from .compressor import ZlibCompressorWrapper, GzipCompressorWrapper, BZ2CompressorWrapper, LZMACompressorWrapper, XZCompressorWrapper, LZ4CompressorWrapper
  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_utils import _ensure_native_byte_order
  from .numpy_pickle_compat import load_compatibility
  from .numpy_pickle_compat import NDArrayWrapper
  from .numpy_pickle_compat import ZNDArrayWrapper
  from .backports import make_memmap
label_desc: Use image node_id 3 for calling the NumpyArrayWrapper obj's underlying member method code with example usage: obj.write_array(array, pickler) without return types