tools/traffic_annotation/scripts/extractor_test.py
def remove_tracebacks(body: str):
  """Removes python tracebacks from the string."""
  regex = re.compile(
      r'''
       # A line that says "Traceback (...):"
       ^Traceback[^\n]*:\n
       # Followed by lines that begin with whitespace.
       ((\s.*)?\n)*''',
      re.MULTILINE | re.VERBOSE)
  return re.sub(regex, '', body)
Removes python tracebacks from the string.
Removes python tracebacks from the string.
Removes python tracebacks from the string .
def remove_tracebacks(body: str):
  regex = re.compile(
      r'''
       # A line that says "Traceback (...):"
       ^Traceback[^\n]*:\n
       # Followed by lines that begin with whitespace.
       ((\s.*)?\n)*''',
      re.MULTILINE | re.VERBOSE)
  return re.sub(regex, '', body)
def remove_tracebacks ( body : str ) : regex = re . compile ( r'''
       # A line that says "Traceback (...):"
       ^Traceback[^\n]*:\n
       # Followed by lines that begin with whitespace.
       ((\s.*)?\n)*''' , re . MULTILINE | re . VERBOSE ) return re . sub ( regex , '' , body )
Removes python tracebacks from the string.
Removes python tracebacks from the string .
"""Removes python tracebacks from the string."""
body
str