code: def match_file(
      filename,
      match_list,
      suffix=None,
      match_suffix=None,
      match_exactly=True,
  ):
      """
      Match a filename or string against a list of other filenames or strings.
  
      Parameters
      ----------
      filename : str
          Filename or string to match.
      match_list : list
          Match to this list of filenames or strings.
      suffix : str, optional
          Suffix of `filename` to be ignored.
      match_suffix : str, optional
          Match only files from `match_list` with this suffix.
      match_exactly : bool, optional
          Matches must be exact, i.e. have the same base name.
  
      Returns
      -------
      list
          List of matched files.
  
      Notes
      -----
      Asterisks "*" can be used to match any string or suffix.
  
      """
      import os
      import fnmatch
  
      # get the base name without the path
      basename = os.path.basename(strip_suffix(filename, suffix))
      # init return list
      matches = []
      # look for files with the same base name in the files_list
      if match_suffix is not None:
          pattern = "*%s*%s" % (basename, match_suffix)
      else:
          pattern = "*%s" % basename
      for match in fnmatch.filter(match_list, pattern):
          # base names must match exactly if indicated
          if (not match_exactly) or (
              basename
              == os.path.basename(strip_suffix(match, match_suffix))
          ):
              matches.append(match)
      # return the matches
      return matches
  
imports: from __future__ import absolute_import, division, print_function
  import argparse
  import contextlib
  import io
  import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: match_file(filename, match_list, suffix, match_suffix, match_exactly) and returns: matches