nodes: 0, module; 1, function_definition; 2, function_name:_sorted_resource_labels; 3, parameters; 4, block; 5, identifier:labels; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, return_statement; 10, comment:"""Sort label names, putting well-known resource labels first."""; 11, assignment; 12, assignment; 13, binary_operator:head + tail; 14, identifier:head; 15, list_comprehension; 16, identifier:tail; 17, call; 18, identifier:head; 19, identifier:tail; 20, identifier:label; 21, for_in_clause; 22, if_clause; 23, identifier:sorted; 24, generator_expression; 25, identifier:label; 26, identifier:TOP_RESOURCE_LABELS; 27, comparison_operator:label in labels; 28, identifier:label; 29, for_in_clause; 30, if_clause; 31, identifier:label; 32, identifier:labels; 33, identifier:label; 34, identifier:labels; 35, comparison_operator:label not in TOP_RESOURCE_LABELS; 36, identifier:label; 37, identifier:TOP_RESOURCE_LABELS
code: def _sorted_resource_labels(labels):
      """Sort label names, putting well-known resource labels first."""
      head = [label for label in TOP_RESOURCE_LABELS if label in labels]
      tail = sorted(label for label in labels if label not in TOP_RESOURCE_LABELS)
      return head + tail