<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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