nodes: 0, module; 1, function_definition; 2, function_name:visit_Module; 3, parameters; 4, block; 5, identifier:self; 6, identifier:node; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, try_statement; 12, assert_statement; 13, expression_statement; 14, expression_statement; 15, return_statement; 16, comment:"""
          Keep everything but function definition then add sorted functions.
  
          Most of the time, many function sort work so we use function calldepth
          as a "sort hint" to simplify typing.
          """; 17, assignment; 18, assignment; 19, identifier:stmt; 20, attribute; 21, block; 22, block; 23, except_clause; 24, comparison_operator:set(newdef) == set(olddef); 25, string:"A function have been lost..."; 26, assignment; 27, assignment; 28, identifier:node; 29, identifier:newbody; 30, call; 31, identifier:olddef; 32, call; 33, identifier:node; 34, identifier:body; 35, if_statement; 36, expression_statement; 37, expression_statement; 38, attribute; 39, block; 40, call; 41, call; 42, attribute; 43, binary_operator:newbody + newdef; 44, attribute; 45, True; 46, identifier:list; 47, argument_list; 48, identifier:list; 49, argument_list; 50, call; 51, block; 52, else_clause; 53, assignment; 54, assignment; 55, attribute; 56, identifier:NetworkXUnfeasible; 57, raise_statement; 58, identifier:set; 59, argument_list; 60, identifier:set; 61, argument_list; 62, identifier:node; 63, identifier:body; 64, identifier:newbody; 65, identifier:newdef; 66, identifier:self; 67, identifier:update; 68, identifier:isinstance; 69, argument_list; 70, expression_statement; 71, block; 72, identifier:newdef; 73, call; 74, identifier:newdef; 75, list_comprehension; 76, identifier:nx; 77, identifier:exception; 78, call; 79, identifier:newdef; 80, identifier:olddef; 81, identifier:stmt; 82, attribute; 83, call; 84, expression_statement; 85, identifier:topological_sort; 86, argument_list; 87, identifier:f; 88, for_in_clause; 89, if_clause; 90, identifier:PythranSyntaxError; 91, argument_list; 92, identifier:ast; 93, identifier:FunctionDef; 94, attribute; 95, argument_list; 96, call; 97, attribute; 98, attribute; 99, identifier:f; 100, identifier:newdef; 101, call; 102, string:"Infinite function recursion"; 103, identifier:olddef; 104, identifier:append; 105, identifier:stmt; 106, attribute; 107, argument_list; 108, identifier:self; 109, identifier:type_dependencies; 110, identifier:self; 111, identifier:ordered_global_declarations; 112, identifier:isinstance; 113, argument_list; 114, identifier:newbody; 115, identifier:append; 116, identifier:stmt; 117, identifier:f; 118, attribute; 119, identifier:ast; 120, identifier:FunctionDef
code: def visit_Module(self, node):
          """
          Keep everything but function definition then add sorted functions.
  
          Most of the time, many function sort work so we use function calldepth
          as a "sort hint" to simplify typing.
          """
          newbody = list()
          olddef = list()
          for stmt in node.body:
              if isinstance(stmt, ast.FunctionDef):
                  olddef.append(stmt)
              else:
                  newbody.append(stmt)
          try:
              newdef = topological_sort(
                  self.type_dependencies,
                  self.ordered_global_declarations)
              newdef = [f for f in newdef if isinstance(f, ast.FunctionDef)]
          except nx.exception.NetworkXUnfeasible:
              raise PythranSyntaxError("Infinite function recursion")
  
          assert set(newdef) == set(olddef), "A function have been lost..."
          node.body = newbody + newdef
          self.update = True
          return node