get_module_data
Get the module data of the given code.
To get the module data of the given code, the code is parsed into an AST and then walked by an ASTWalker. The ModuleDataBuilder detects the scope of each node and builds a scope tree. The ModuleDataBuilder also collects all classes, functions, global variables, value nodes, target nodes, parameters, function calls, and function references.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code |
str
|
The source code of the module whose module data is to be found. |
required |
module_name |
str
|
The name of the module, by default "". |
''
|
path |
str | None
|
The path of the module, by default None. |
None
|
Returns:
| Type | Description |
|---|---|
ModuleData
|
The module data of the given module. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the code has invalid syntax. |