code: def check_diffs(
      hunks: Iterable[diff_parser.Hunk],
      *,
      prohibited_regex: str,
      suppression_regex: str | None = None,
  ) -> list[RegexLocation]:
      """Checks FileDiffs for prohibited regexes.
  
      Arguments:
        hunks: A sequence of Hunk objects representing the hunks of the diff.
        prohibited_regex: The regex that isn't allowed in the diff.
        suppression_regex: A regex used as an escape hatch to allow the prohibited
          regex in the diff. If this is found on the same line as prohibited_regex,
          there is no error.
  
      Returns:
        A list of RegexLocations where the prohibited_regex is found.
      """
  
      prohibited_regex = re.compile(prohibited_regex)
      if suppression_regex is not None:
          suppression_regex = re.compile(suppression_regex)
  
      def should_not_suppress(line) -> bool:
          if suppression_regex:
              return not suppression_regex.search(line)
          return True
  
      regex_locations = []
      for hunk in hunks:
          for line_no, line in hunk.added_lines():
              if should_not_suppress(line):
                  regex_locations.extend(
                      [
                          RegexLocation(
                              hunk.file,
                              line_no,
                              line,
                              regex_match.group(),
                          )
                          for regex_match in prohibited_regex.finditer(
                              line
                          )
                      ]
                  )
  
      return regex_locations
  
file_path: tensorflow-upstream/third_party/xla/build_tools/lint/check_contents.py
imports: import argparse
  import dataclasses
  import logging
  import re
  import sys
  from typing import Iterable, Sequence
  from xla.build_tools.lint import diff_parser
label_desc: Use image node_id 2 for calling a global function with example usage: check_diffs(hunks) and returns: regex_locations, True, unknown