parameters: (self, accept_header, index)
docstring: Parse component of an Accept header.
  
      Args:
        accept_header: Unparsed sub-expression of accept header.
        index: The index that this accept item was found in the Accept header.
docstring_summary: Parse component of an Accept header.
docstring_tokens: Parse component of an Accept header .
function: def __init__(self, accept_header, index):
      """Parse component of an Accept header.
  
      Args:
        accept_header: Unparsed sub-expression of accept header.
        index: The index that this accept item was found in the Accept header.
      """
      accept_header = accept_header.lower()
      content_type, values = cgi.parse_header(accept_header)
      match = self.__CONTENT_TYPE_REGEX.match(content_type)
      if not match:
        raise AcceptError('Not valid Accept header: %s' % accept_header)
      self.__index = index
      self.__main_type = match.group(1)
      self.__sub_type = match.group(2)
      self.__q = float(values.get('q', 1))
      self.__values = values
  
      if self.__main_type == '*':
        self.__main_type = None
  
      if self.__sub_type == '*':
        self.__sub_type = None
  
      self.__sort_key = (not self.__main_type,
                         not self.__sub_type,
                         -self.__q,
                         not self.__values,
                         self.__index)
function_tokens: def __init__ ( self , accept_header , index ) : accept_header = accept_header . lower ( ) content_type , values = cgi . parse_header ( accept_header ) match = self . __CONTENT_TYPE_REGEX . match ( content_type ) if not match : raise AcceptError ( 'Not valid Accept header: %s' % accept_header ) self . __index = index self . __main_type = match . group ( 1 ) self . __sub_type = match . group ( 2 ) self . __q = float ( values . get ( 'q' , 1 ) ) self . __values = values if self . __main_type == '*' : self . __main_type = None if self . __sub_type == '*' : self . __sub_type = None self . __sort_key = ( not self . __main_type , not self . __sub_type , - self . __q , not self . __values , self . __index )