code: def is_file_excluded(filename, excludes):
      
      # check if you need to exclude this file
      return any([exclude and re.match(exclude, filename) is not None
                  for exclude in excludes])
docs: Check if the file should be excluded.
  
      :param filename: file name
      :param excludes: list of regex to match
      :return: True if the file should be excluded