nodes: 0, module; 1, function_definition; 2, function_name:alphanum_order; 3, parameters; 4, block; 5, identifier:triples; 6, expression_statement; 7, return_statement; 8, comment:"""
      Sort a list of triples by relation name.
  
      Embedded integers are sorted numerically, but otherwise the sorting
      is alphabetic.
      """; 9, call; 10, identifier:sorted; 11, argument_list; 12, identifier:triples; 13, keyword_argument; 14, identifier:key; 15, lambda; 16, lambda_parameters; 17, list_comprehension; 18, identifier:t; 19, conditional_expression:int(t) if t.isdigit() else t; 20, for_in_clause; 21, call; 22, call; 23, identifier:t; 24, identifier:t; 25, call; 26, identifier:int; 27, argument_list; 28, attribute; 29, argument_list; 30, attribute; 31, argument_list; 32, identifier:t; 33, identifier:t; 34, identifier:isdigit; 35, identifier:re; 36, identifier:split; 37, string; 38, boolean_operator; 39, string_content:([0-9]+); 40, attribute; 41, string; 42, identifier:t; 43, identifier:relation
code: def alphanum_order(triples):
      """
      Sort a list of triples by relation name.
  
      Embedded integers are sorted numerically, but otherwise the sorting
      is alphabetic.
      """
      return sorted(
          triples,
          key=lambda t: [
              int(t) if t.isdigit() else t
              for t in re.split(r'([0-9]+)', t.relation or '')
          ]
      )