nodes: 0, module; 1, function_definition; 2, function_name:split_and_sort; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""
          Split the graphs into sub graphs and return a list of all graphs sorted
          by the number of nodes. The graph with most nodes is returned first.
          """; 12, assignment; 13, call; 14, pattern_list; 15, call; 16, block; 17, identifier:graphs; 18, identifier:graphs; 19, call; 20, attribute; 21, argument_list; 22, identifier:index; 23, identifier:graph; 24, identifier:enumerate; 25, argument_list; 26, expression_statement; 27, identifier:list; 28, argument_list; 29, identifier:graphs; 30, identifier:sort; 31, keyword_argument; 32, identifier:graphs; 33, assignment; 34, call; 35, identifier:key; 36, lambda; 37, attribute; 38, identifier:index; 39, attribute; 40, argument_list; 41, lambda_parameters; 42, unary_operator; 43, identifier:graph; 44, identifier:index; 45, identifier:self; 46, identifier:split; 47, identifier:x; 48, call; 49, identifier:len; 50, argument_list; 51, attribute; 52, identifier:x; 53, identifier:metadata
code: def split_and_sort(self):
          """
          Split the graphs into sub graphs and return a list of all graphs sorted
          by the number of nodes. The graph with most nodes is returned first.
          """
          graphs = list(self.split())
          graphs.sort(key=lambda x: -len(x.metadata))
          for index, graph in enumerate(graphs):
              graph.index = index
          return graphs