code: def _savez(
      file, args, kwds, compress, allow_pickle=True, pickle_kwargs=None
  ):
      # Import is postponed to here since zipfile depends on gzip, an optional
      # component of the so-called standard library.
      import zipfile
  
      if not hasattr(file, "read"):
          file = os_fspath(file)
          if not file.endswith(".npz"):
              file = file + ".npz"
  
      namedict = kwds
      for i, val in enumerate(args):
          key = "arr_%d" % i
          if key in namedict.keys():
              raise ValueError(
                  "Cannot use un-named variables and keyword %s" % key
              )
          namedict[key] = val
  
      if compress:
          compression = zipfile.ZIP_DEFLATED
      else:
          compression = zipfile.ZIP_STORED
  
      zipf = zipfile_factory(file, mode="w", compression=compression)
  
      if sys.version_info >= (3, 6):
          # Since Python 3.6 it is possible to write directly to a ZIP file.
          for key, val in namedict.items():
              fname = key + ".npy"
              val = np.asanyarray(val)
              force_zip64 = val.nbytes >= 2**30
              with zipf.open(
                  fname, "w", force_zip64=force_zip64
              ) as fid:
                  format.write_array(
                      fid,
                      val,
                      allow_pickle=allow_pickle,
                      pickle_kwargs=pickle_kwargs,
                  )
      else:
          # Stage arrays in a temporary file on disk, before writing to zip.
  
          # Import deferred for startup time improvement
          import tempfile
  
          # Since target file might be big enough to exceed capacity of a global
          # temporary directory, create temp file side-by-side with the target file.
          file_dir, file_prefix = (
              os.path.split(file)
              if _is_string_like(file)
              else (None, "tmp")
          )
          fd, tmpfile = tempfile.mkstemp(
              prefix=file_prefix, dir=file_dir, suffix="-numpy.npy"
          )
          os.close(fd)
          try:
              for key, val in namedict.items():
                  fname = key + ".npy"
                  fid = open(tmpfile, "wb")
                  try:
                      format.write_array(
                          fid,
                          np.asanyarray(val),
                          allow_pickle=allow_pickle,
                          pickle_kwargs=pickle_kwargs,
                      )
                      fid.close()
                      fid = None
                      zipf.write(tmpfile, arcname=fname)
                  except IOError as exc:
                      raise IOError(
                          "Failed to write to %s: %s" % (tmpfile, exc)
                      )
                  finally:
                      if fid:
                          fid.close()
          finally:
              os.remove(tmpfile)
  
      zipf.close()
  
imports: from __future__ import division, absolute_import, print_function
  import sys
  import os
  import re
  import functools
  import itertools
  import warnings
  import weakref
  from operator import itemgetter, index
  import numpy
  from .None import format
  from ._datasource import DataSource
  from numpy.core import overrides
  from numpy.core.multiarray import packbits, unpackbits
  from numpy.core.overrides import set_module
  from numpy.core._internal import recursive
  from ._iotools import LineSplitter, NameValidator, StringConverter, ConverterError, ConverterLockError, ConversionWarning, _is_string_like, has_nested_fields, flatten_dtype, easy_dtype, _decode_line
  from numpy.compat import asbytes, asstr, asunicode, asbytes_nested, bytes, basestring, unicode, os_fspath, os_PathLike
  from numpy.core.numeric import pickle
label_desc: Use image node_id 10 for calling a global function with example usage: _savez(file, args, kwds, compress, allow_pickle, pickle_kwargs) without return types