code: def dump(value, filename, compress=0, protocol=None, cache_size=None):
      """Persist an arbitrary Python object into one file.
  
      Parameters
      -----------
      value: any Python object
          The object to store to disk.
      filename: str or pathlib.Path
          The path of the file in which it is to be stored. The compression
          method corresponding to one of the supported filename extensions ('.z',
          '.gz', '.bz2', '.xz' or '.lzma') will be used automatically.
      compress: int from 0 to 9 or bool or 2-tuple, optional
          Optional compression level for the data. 0 or False is no compression.
          Higher value means more compression, but also slower read and
          write times. Using a value of 3 is often a good compromise.
          See the notes for more details.
          If compress is True, the compression level used is 3.
          If compress is a 2-tuple, the first element must correspond to a string
          between supported compressors (e.g 'zlib', 'gzip', 'bz2', 'lzma'
          'xz'), the second element must be an integer from 0 to 9, corresponding
          to the compression level.
      protocol: positive int
          Pickle protocol, see pickle.dump documentation for more details.
      cache_size: positive int, optional
          This option is deprecated in 0.10 and has no effect.
  
      Returns
      -------
      filenames: list of strings
          The list of file names in which the data is stored. If
          compress is false, each array is stored in a different file.
  
      See Also
      --------
      joblib.load : corresponding loader
  
      Notes
      -----
      Memmapping on load cannot be used for compressed files. Thus
      using compression can significantly slow down loading. In
      addition, compressed files take extra extra memory during
      dump and load.
  
      """
  
      if Path is not None and isinstance(filename, Path):
          filename = str(filename)
  
      is_filename = isinstance(filename, _basestring)
      is_fileobj = hasattr(filename, "write")
  
      compress_method = (
          "zlib"  # zlib is the default compression method.
      )
      if compress is True:
          # By default, if compress is enabled, we want to be using 3 by default
          compress_level = 3
      elif isinstance(compress, tuple):
          # a 2-tuple was set in compress
          if len(compress) != 2:
              raise ValueError(
                  "Compress argument tuple should contain exactly 2 elements: "
                  "(compress method, compress level), you passed {0}".format(
                      compress
                  )
              )
          compress_method, compress_level = compress
      else:
          compress_level = compress
  
      if compress_level is not False and compress_level not in range(
          10
      ):
          # Raising an error if a non valid compress level is given.
          raise ValueError(
              'Non valid compress level given: "{0}". Possible values are '
              "{1}.".format(compress_level, list(range(10)))
          )
  
      if compress_method not in _COMPRESSORS:
          # Raising an error if an unsupported compression method is given.
          raise ValueError(
              'Non valid compression method given: "{0}". Possible values are '
              "{1}.".format(compress_method, _COMPRESSORS)
          )
  
      if not is_filename and not is_fileobj:
          # People keep inverting arguments, and the resulting error is
          # incomprehensible
          raise ValueError(
              "Second argument should be a filename or a file-like object, "
              "%s (type %s) was given." % (filename, type(filename))
          )
  
      if is_filename and not isinstance(compress, tuple):
          # In case no explicit compression was requested using both compression
          # method and level in a tuple and the filename has an explicit
          # extension, we select the corresponding compressor.
          if filename.endswith(".z"):
              compress_method = "zlib"
          elif filename.endswith(".gz"):
              compress_method = "gzip"
          elif filename.endswith(".bz2"):
              compress_method = "bz2"
          elif filename.endswith(".lzma"):
              compress_method = "lzma"
          elif filename.endswith(".xz"):
              compress_method = "xz"
          else:
              # no matching compression method found, we unset the variable to
              # be sure no compression level is set afterwards.
              compress_method = None
  
          if compress_method in _COMPRESSORS and compress_level == 0:
              # we choose a default compress_level of 3 in case it was not given
              # as an argument (using compress).
              compress_level = 3
  
      if not PY3_OR_LATER and compress_method in ("lzma", "xz"):
          raise NotImplementedError(
              "{0} compression is only available for "
              "python version >= 3.3. You are using "
              "{1}.{2}".format(
                  compress_method,
                  sys.version_info[0],
                  sys.version_info[1],
              )
          )
  
      if cache_size is not None:
          # Cache size is deprecated starting from version 0.10
          warnings.warn(
              "Please do not set 'cache_size' in joblib.dump, "
              "this parameter has no effect and will be removed. "
              "You used 'cache_size={0}'".format(cache_size),
              DeprecationWarning,
              stacklevel=2,
          )
  
      if compress_level != 0:
          with _write_fileobject(
              filename, compress=(compress_method, compress_level)
          ) as f:
              NumpyPickler(f, protocol=protocol).dump(value)
      elif is_filename:
          with open(filename, "wb") as f:
              NumpyPickler(f, protocol=protocol).dump(value)
      else:
          NumpyPickler(filename, protocol=protocol).dump(value)
  
      # If the target container is a file object, nothing is returned.
      if is_fileobj:
          return
  
      # For compatibility, the list of created filenames (e.g with one element
      # after 0.10.0) is returned by default.
      return [filename]
  
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 1 for calling a global function with example usage: dump(value, filename, compress, protocol, cache_size) and returns: list