code: def _find_snapshot_files(fmt, path):
      """Only prefix and suffix match
  
      TODO(kuenishi): currently clean format string such as
      "snapshot{.iteration}.npz" can only be parsed, but tricky (or
      invalid) formats like "snapshot{{.iteration}}.npz" are hard to
      detect and to properly show errors, just ignored or fails so far.
  
      Args:
          fmt (str): format string to match with file names of
              existing snapshots, where prefix and suffix are
              only examined. Also, files' staleness is judged
              by timestamps. The default is metime.
          path (str): a directory path to search for snapshot files.
  
      Returns:
          A sorted list of pair of ``mtime, filename``, whose file
          name that matched the format ``fmt`` directly under ``path``.
  
      """
      prefix = fmt.split("{")[0]
      suffix = fmt.split("}")[-1]
  
      matched_files = (
          file
          for file in os.listdir(path)
          if file.startswith(prefix) and file.endswith(suffix)
      )
  
      def _prepend_mtime(f):
          t = os.stat(os.path.join(path, f)).st_mtime
          return (t, f)
  
      return sorted(_prepend_mtime(file) for file in matched_files)
  
imports: import os
  import warnings
  import chainer
  from chainer.serializers import npz
  from chainer.training import extension
  from chainer.training.extensions import snapshot_writers
  from chainer.utils import argument
label_desc: Use image node_id 1 for calling a global function with example usage: _find_snapshot_files(fmt, path) and returns: sorted, t,  f