nodes: 0, module; 1, function_definition; 2, function_name:sort_protein_group; 3, parameters; 4, block; 5, identifier:pgroup; 6, identifier:sortfunctions; 7, identifier:sortfunc_index; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, for_statement; 13, return_statement; 14, comment:"""Recursive function that sorts protein group by a number of sorting
      functions."""; 15, assignment; 16, assignment; 17, augmented_assignment; 18, identifier:subgroup; 19, identifier:subgroups; 20, block; 21, identifier:pgroup_out; 22, identifier:pgroup_out; 23, list; 24, identifier:subgroups; 25, call; 26, identifier:sortfunc_index; 27, integer:1; 28, if_statement; 29, subscript; 30, argument_list; 31, boolean_operator; 32, block; 33, else_clause; 34, identifier:sortfunctions; 35, identifier:sortfunc_index; 36, identifier:pgroup; 37, comparison_operator:len(subgroup) > 1; 38, comparison_operator:sortfunc_index < len(sortfunctions); 39, expression_statement; 40, block; 41, call; 42, integer:1; 43, identifier:sortfunc_index; 44, call; 45, call; 46, expression_statement; 47, identifier:len; 48, argument_list; 49, identifier:len; 50, argument_list; 51, attribute; 52, argument_list; 53, call; 54, identifier:subgroup; 55, identifier:sortfunctions; 56, identifier:pgroup_out; 57, identifier:extend; 58, call; 59, attribute; 60, argument_list; 61, identifier:sort_protein_group; 62, argument_list; 63, identifier:pgroup_out; 64, identifier:extend; 65, identifier:subgroup; 66, identifier:subgroup; 67, identifier:sortfunctions; 68, identifier:sortfunc_index
code: def sort_protein_group(pgroup, sortfunctions, sortfunc_index):
      """Recursive function that sorts protein group by a number of sorting
      functions."""
      pgroup_out = []
      subgroups = sortfunctions[sortfunc_index](pgroup)
      sortfunc_index += 1
      for subgroup in subgroups:
          if len(subgroup) > 1 and sortfunc_index < len(sortfunctions):
              pgroup_out.extend(sort_protein_group(subgroup,
                                                   sortfunctions,
                                                   sortfunc_index))
          else:
              pgroup_out.extend(subgroup)
      return pgroup_out