File size: 322 Bytes
f8a39f0
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import ast

def parse_code(source_code: str) -> ast.AST:
    """

    Parses Python source code into an Abstract Syntax Tree (AST).



    Parameters:

        source_code (str): Python source code as a string.



    Returns:

        ast.AST: Parsed abstract syntax tree.

    """
    return ast.parse(source_code)