import ast
import tokenize


def generate_ast(filename: str):
    """
    This function generates the AST of a python file using Python's ast
    module.
    """
    return ast.parse(tokenize.open(filename).read())