parameters: (patches)
return_statement: return valid_files
docstring: Take a patch file generated by git diff, and scan the patch for a list of files to check.
docstring_summary: Take a patch file generated by git diff, and scan the patch for a list of files to check.
docstring_tokens: Take a patch file generated by git diff and scan the patch for a list of files to check .
function: def get_files_to_check_from_patch(patches):
      """Take a patch file generated by git diff, and scan the patch for a list of files to check.
      """
      candidates = []
  
      # Get a list of candidate_files
      check = re.compile(r"^diff --git a\/([\w\/\.\-]+) b\/[\w\/\.\-]+")
  
      lines = []
      for patch in patches:
          with open(patch, "rb") as infile:
              lines += infile.readlines()
  
      candidates = [check.match(line).group(1) for line in lines if check.match(line)]
  
      repos = get_repos()
  
      valid_files = list(itertools.chain.from_iterable([r.get_candidates(candidates) for r in repos]))
  
      return valid_files
function_tokens: def get_files_to_check_from_patch ( patches ) : candidates = [ ] # Get a list of candidate_files check = re . compile ( r"^diff --git a\/([\w\/\.\-]+) b\/[\w\/\.\-]+" ) lines = [ ] for patch in patches : with open ( patch , "rb" ) as infile : lines += infile . readlines ( ) candidates = [ check . match ( line ) . group ( 1 ) for line in lines if check . match ( line ) ] repos = get_repos ( ) valid_files = list ( itertools . chain . from_iterable ( [ r . get_candidates ( candidates ) for r in repos ] ) ) return valid_files