code: def filter_files(files, suffix):
      """
      Filter the list to contain only files matching the given `suffix`.
  
      Parameters
      ----------
      files : list
          List of files to be filtered.
      suffix : str
          Return only files matching this suffix.
  
      Returns
      -------
      list
          List of files.
  
      """
      import fnmatch
  
      # make sure files is a list
      if not isinstance(files, list):
          files = [files]
      # no suffix given, return the list unaltered
      if suffix is None:
          return files
      # filter the files with the given suffix
      file_list = []
      if isinstance(suffix, list):
          # a list of suffices is given
          for s in suffix:
              file_list.extend(fnmatch.filter(files, "*%s" % s))
      else:
          # a single suffix is given
          file_list.extend(fnmatch.filter(files, "*%s" % suffix))
      # return the filtered list
      return file_list
  
imports: from __future__ import absolute_import, division, print_function
  import argparse
  import contextlib
  import io
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: filter_files(files, suffix) and returns: file_list, files