parameters: (data)
return_statement: return token_list
docstring: Parses a header value which follows 1#token and returns parsed elements
      as a list of strings.
  
      Leading LWSes must be trimmed.
docstring_summary: Parses a header value which follows 1#token and returns parsed elements
      as a list of strings.
docstring_tokens: Parses a header value which follows 1#token and returns parsed elements as a list of strings .
function: def parse_token_list(data):
      """Parses a header value which follows 1#token and returns parsed elements
      as a list of strings.
  
      Leading LWSes must be trimmed.
      """
  
      state = http_header_util.ParsingState(data)
  
      token_list = []
  
      while True:
          token = http_header_util.consume_token(state)
          if token is not None:
              token_list.append(token)
  
          http_header_util.consume_lwses(state)
  
          if http_header_util.peek(state) is None:
              break
  
          if not http_header_util.consume_string(state, ','):
              raise HandshakeException(
                  'Expected a comma but found %r' % http_header_util.peek(state))
  
          http_header_util.consume_lwses(state)
  
      if len(token_list) == 0:
          raise HandshakeException('No valid token found')
  
      return token_list
function_tokens: def parse_token_list ( data ) : state = http_header_util . ParsingState ( data ) token_list = [ ] while True : token = http_header_util . consume_token ( state ) if token is not None : token_list . append ( token ) http_header_util . consume_lwses ( state ) if http_header_util . peek ( state ) is None : break if not http_header_util . consume_string ( state , ',' ) : raise HandshakeException ( 'Expected a comma but found %r' % http_header_util . peek ( state ) ) http_header_util . consume_lwses ( state ) if len ( token_list ) == 0 : raise HandshakeException ( 'No valid token found' ) return token_list