tools/traffic_annotation/scripts/generator_utils.py
def find_chrome_browser_version(doc):
  """Finds what the current chrome browser version is in the document.

  We grab the current "Chrome Browser version MAJOR.MINOR.BUILD.PATCH" from the
  document's header.

  Returns: str
    The chrome browser version string.
  """
  # Only one header.
  header = extract_body(document=doc, target="headers").values()[0]
  header_elements = header["content"][0]["paragraph"]["elements"]
  text = header_elements[0]["textRun"]["content"]
  current_version = re.search(r"([\d.]+)", text).group()
  return current_version
Finds what the current chrome browser version is in the document.

  We grab the current "Chrome Browser version MAJOR.MINOR.BUILD.PATCH" from the
  document's header.

  Returns: str
    The chrome browser version string.
  
Finds what the current chrome browser version is in the document.
We grab the current "Chrome Browser version MAJOR.MINOR.BUILD.PATCH" from the
document's header.

str
The chrome browser version string.
Finds what the current chrome browser version is in the document . We grab the current " Chrome Browser version MAJOR . MINOR . BUILD . PATCH " from the document ' s header . str The chrome browser version string .
def find_chrome_browser_version(doc):
  header = extract_body(document=doc, target="headers").values()[0]
  header_elements = header["content"][0]["paragraph"]["elements"]
  text = header_elements[0]["textRun"]["content"]
  current_version = re.search(r"([\d.]+)", text).group()
  return current_version
def find_chrome_browser_version ( doc ) : header = extract_body ( document = doc , target = "headers" ) . values ( ) [ 0 ] header_elements = header [ "content" ] [ 0 ] [ "paragraph" ] [ "elements" ] text = header_elements [ 0 ] [ "textRun" ] [ "content" ] current_version = re . search ( r"([\d.]+)" , text ) . group ( ) return current_version
Finds what the current chrome browser version is in the document.
Finds what the current chrome browser version is in the document .
"""Finds what the current chrome browser version is in the document.

  We grab the current "Chrome Browser version MAJOR.MINOR.BUILD.PATCH" from the
  document's header.

  Returns: str
    The chrome browser version string.
  """ # Only one header.
doc