code: def save_npz(file, obj, compression=True):
      """Saves an object to the file in NPZ format.
  
      This is a short-cut function to save only one object into an NPZ file.
  
      Args:
          file (str or file-like): Target file to write to.
          obj: Object to be serialized. It must support serialization protocol.
              If it is a dictionary object, the serialization will be skipped.
          compression (bool): If ``True``, compression in the resulting zip file
              is enabled.
  
      .. seealso::
          :func:`chainer.serializers.load_npz`
  
      """
      if isinstance(file, six.string_types):
          with open(file, "wb") as f:
              save_npz(f, obj, compression)
          return
  
      if isinstance(obj, dict):
          target = obj
      else:
          s = DictionarySerializer()
          s.save(obj)
          target = s.target
  
      if compression:
          numpy.savez_compressed(file, **target)
      else:
          numpy.savez(file, **target)
  
imports: import numpy
  import six
  from chainer.backends import _chainerx
  from chainer.backends import _cpu
  from chainer.backends import cuda
  from chainer.backends import intel64
  from chainer import serializer
  import chainerx
label_desc: Use image node_id 2 for calling a global function with example usage: save_npz(file, obj, compression) without return types