code: def match_file(patterns, file):
      """
      Matches the file to the patterns.
  
      *patterns* (:class:`~collections.abc.Iterable` of :class:`~pathspec.pattern.Pattern`)
      contains the patterns to use.
  
      *file* (:class:`str`) is the normalized file path to be matched
      against *patterns*.
  
      Returns :data:`True` if *file* matched; otherwise, :data:`False`.
      """
      matched = False
      for pattern in patterns:
          if pattern.include is not None:
              if file in pattern.match((file,)):
                  matched = pattern.include
      return matched
  
imports: import os
  import os.path
  import posixpath
  import stat
  from .compat import Collection, Iterable, string_types, unicode
label_desc: Use image node_id 7 for calling a global function with example usage: match_file(patterns, file) and returns: matched