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