code: def file_matches(filename, patterns):
      
      return any(fnmatch.fnmatch(filename, pat)
                 or fnmatch.fnmatch(os.path.basename(filename), pat)
                 for pat in patterns)
docs: Does this filename match any of the patterns?