class_docstr: Base class of snapshot writers.
  
  :class:`~chainer.training.extensions.Snapshot` invokes ``__call__`` of this
  class every time when taking a snapshot.
  This class determines how the actual saving function will be invoked.
  
  .. seealso::
  
      - :meth:`chainer.training.extensions.snapshot`
docstr: Invokes the actual snapshot function.
  
  This method is invoked by a
  :class:`~chainer.training.extensions.Snapshot` object every time it
  takes a snapshot.
  
  Args:
      filename (str): Name of the file into which the serialized target
          is saved. It is a concrete file name, i.e. not a pre-formatted
          template string.
      outdir (str): Output directory. Corresponds to
          :py:attr:`Trainer.out <chainer.training.Trainer.out>`.
      target (dict): Serialized object which will be saved.
docstr_tok: ["Invokes","the","actual","snapshot","function",".","This","method","is","invoked","by","a",":","class",":","`","~chainer.training.extensions.Snapshot","`","object","every","time","it","takes","a","snapshot",".","Args",":","filename","(","str",")",":","Name","of","the","file","into","which","the","serialized","target","is","saved",".","It","is","a","concrete","file","name",",","i.e",".","not","a","pre-formatted","template","string",".","outdir","(","str",")",":","Output","directory",".","Corresponds","to",":","py",":","attr",":","`","Trainer.out","<","chainer.training.Trainer.out",">","`",".","target","(","dict",")",":","Serialized","object","which","will","be","saved","."]
code: def __call__(self, filename, outdir, target):
      """Invokes the actual snapshot function.
  
      This method is invoked by a
      :class:`~chainer.training.extensions.Snapshot` object every time it
      takes a snapshot.
  
      Args:
          filename (str): Name of the file into which the serialized target
              is saved. It is a concrete file name, i.e. not a pre-formatted
              template string.
          outdir (str): Output directory. Corresponds to
              :py:attr:`Trainer.out <chainer.training.Trainer.out>`.
          target (dict): Serialized object which will be saved.
      """
      raise NotImplementedError
  
imports: import multiprocessing
  import os
  import shutil
  import threading
  from six.moves import queue
  from chainer.serializers import npz
  from chainer import utils
label_desc: Use image node_id 2 for calling the Writer obj's underlying member method code with example usage: obj.__call__(filename, outdir, target) without return types