nodes: 0, module; 1, function_definition; 2, function_name:extension_sort_key; 3, parameters; 4, block; 5, identifier:extension; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, return_statement; 10, comment:"""Returns the sorting key for an extension.
  
      The sorting key can be used to sort a list of extensions
      into the order that is used in the Khronos C OpenGL headers.
      :param Extension extension: Extension to produce sort key for
      :returns: A sorting key
      """; 11, assignment; 12, assignment; 13, conditional_expression:(0, name) if category in ('ARB', 'KHR', 'OES') else (1, name); 14, identifier:name; 15, attribute; 16, identifier:category; 17, subscript; 18, tuple; 19, comparison_operator:category in ('ARB', 'KHR', 'OES'); 20, tuple; 21, identifier:extension; 22, identifier:name; 23, call; 24, integer:1; 25, integer:0; 26, identifier:name; 27, identifier:category; 28, tuple; 29, integer:1; 30, identifier:name; 31, attribute; 32, argument_list; 33, string; 34, string; 35, string; 36, identifier:name; 37, identifier:split; 38, string; 39, integer:2; 40, string_content:ARB; 41, string_content:KHR; 42, string_content:OES; 43, string_content:_
code: def extension_sort_key(extension):
      """Returns the sorting key for an extension.
  
      The sorting key can be used to sort a list of extensions
      into the order that is used in the Khronos C OpenGL headers.
      :param Extension extension: Extension to produce sort key for
      :returns: A sorting key
      """
      name = extension.name
      category = name.split('_', 2)[1]
      return (0, name) if category in ('ARB', 'KHR', 'OES') else (1, name)