code: def parse_extension_item(
      header: str, pos: int, header_name: str
  ) -> Tuple[ExtensionHeader, int]:
      
      # Extract extension name.
      name, pos = parse_token(header, pos, header_name)
      pos = parse_OWS(header, pos)
      # Extract all parameters.
      parameters = []
      while peek_ahead(header, pos) == ";":
          pos = parse_OWS(header, pos + 1)
          parameter, pos = parse_extension_item_param(header, pos, header_name)
          parameters.append(parameter)
      return (name, parameters), pos
docs: Parse an extension definition from ``header`` at the given position.
  
      Return an ``(extension name, parameters)`` pair, where ``parameters`` is a
      list of ``(name, value)`` pairs, and the new position.
  
      Raise :exc:`~websockets.exceptions.InvalidHeaderFormat` on invalid inputs.