parameters: (state)
docstring: Consumes a token or a quoted-string, and returns the token or unquoted
      string. If no token or quoted-string was found, returns None.
docstring_summary: Consumes a token or a quoted-string, and returns the token or unquoted
      string. If no token or quoted-string was found, returns None.
docstring_tokens: Consumes a token or a quoted - string and returns the token or unquoted string . If no token or quoted - string was found returns None .
function: def consume_token_or_quoted_string(state):
      """Consumes a token or a quoted-string, and returns the token or unquoted
      string. If no token or quoted-string was found, returns None.
      """
  
      original_head = state.head
  
      if not consume_string(state, '"'):
          return consume_token(state)
  
      result = []
  
      expect_quoted_pair = False
  
      while True:
          if not expect_quoted_pair and consume_lws(state):
              result.append(' ')
              continue
  
          c = consume(state)
          if c is None:
              # quoted-string is not enclosed with double quotation
              state.head = original_head
              return None
          elif expect_quoted_pair:
              expect_quoted_pair = False
              if _is_char(c):
                  result.append(c)
              else:
                  # Non CHAR character found in quoted-pair
                  state.head = original_head
                  return None
          elif c == '\\':
              expect_quoted_pair = True
          elif c == '"':
              return ''.join(result)
          elif _is_ctl(c):
              # Invalid character %r found in qdtext
              state.head = original_head
              return None
          else:
              result.append(c)
function_tokens: def consume_token_or_quoted_string ( state ) : original_head = state . head if not consume_string ( state , '"' ) : return consume_token ( state ) result = [ ] expect_quoted_pair = False while True : if not expect_quoted_pair and consume_lws ( state ) : result . append ( ' ' ) continue c = consume ( state ) if c is None : # quoted-string is not enclosed with double quotation state . head = original_head return None elif expect_quoted_pair : expect_quoted_pair = False if _is_char ( c ) : result . append ( c ) else : # Non CHAR character found in quoted-pair state . head = original_head return None elif c == '\\' : expect_quoted_pair = True elif c == '"' : return '' . join ( result ) elif _is_ctl ( c ) : # Invalid character %r found in qdtext state . head = original_head return None else : result . append ( c )