code: def parse_token(header: str, pos: int, header_name: str) -> Tuple[str, int]:
      
      match = _token_re.match(header, pos)
      if match is None:
          raise InvalidHeaderFormat(header_name, "expected token", header, pos)
      return match.group(), match.end()
docs: Parse a token from ``header`` at the given position.
  
      Return the token value and the new position.
  
      Raise :exc:`~websockets.exceptions.InvalidHeaderFormat` on invalid inputs.