tools/traffic_annotation/scripts/annotation_tokenizer.py
def maybe_advance(self, expected_type: str) -> Optional[str]:
    """Advance the tokenizer by one token if it has |expected_type|.

    Args:
      expected_type: expected |type| attribute of the token.

    Returns:
      The |value| attribute of the token if it has the right type, or None if it
      has another type.
    """
    token = self._get_token()
    if token and token.type == expected_type:
      self.pos = token.pos
      return token.value
    return None
Advance the tokenizer by one token if it has |expected_type|.

    Args:
      expected_type: expected |type| attribute of the token.

    Returns:
      The |value| attribute of the token if it has the right type, or None if it
      has another type.
    
Advance the tokenizer by one token if it has |expected_type|.
Advance the tokenizer by one token if it has |expected_type| .
def maybe_advance(self, expected_type: str) -> Optional[str]:
    token = self._get_token()
    if token and token.type == expected_type:
      self.pos = token.pos
      return token.value
    return None
def maybe_advance ( self , expected_type : str ) -> Optional [ str ] : token = self . _get_token ( ) if token and token . type == expected_type : self . pos = token . pos return token . value return None
Advance the tokenizer by one token if it has |expected_type|.
Advance the tokenizer by one token if it has |expected_type| .
"""Advance the tokenizer by one token if it has |expected_type|.

    Args:
      expected_type: expected |type| attribute of the token.

    Returns:
      The |value| attribute of the token if it has the right type, or None if it
      has another type.
    """
The |value| attribute of the token if it has the right type, or None if it
has another type.
The |value| attribute of the token if it has the right type or None if it has another type .
self
expected_type
str
expected |type| attribute of the token.
expected |type| attribute of the token .