import ast


def parse_module(m_ast):
    """
    Get the function, class and import nodes for a module
    Args:
        m_ast: The AST tree to get the nodes for
    Returns:
        Tuple containing list of function nodes, list of class nodes and list of import nodes
    """
    fun_nodes = []
    class_nodes = []
    import_nodes = []

    for node in ast.walk(m_ast):
        if isinstance(node, ast.FunctionDef):
            fun_nodes += [node]
        if isinstance(node, ast.ClassDef):
            class_nodes += [node]
        if isinstance(node, ast.Import) or isinstance(node, ast.ImportFrom):
            import_nodes += [node]

    return fun_nodes, class_nodes, import_nodes