code: def check_file_for_aws_keys(filenames, keys):
      # type: (Sequence[str], Set[str]) -> List[Dict[str, str]]
      
      bad_files = []
  
      for filename in filenames:
          with open(filename, 'r') as content:
              text_body = content.read()
              for key in keys:
                  # naively match the entire file, low chance of incorrect
                  # collision
                  if key in text_body:
                      bad_files.append({
                          'filename': filename, 'key': key[:4] + '*' * 28,
                      })
      return bad_files
docs: Check if files contain AWS secrets.
  
      Return a list of all files containing AWS secrets and keys found, with all
      but the first four characters obfuscated to ease debugging.