generic function to calculate SHA256 hash of a string
generic function to return the code section for a node
returns all the valid index types
- fname -
the file name to parse. If this is not provided, then all other values must be provided.
- code -
the code text can be provided instead of the.
- name -
The name of the node. Defaults to "".
- type -
The type of the node. Defaults to None.
- node -
The AST node. Defaults to None.
- code_lines -
The code lines. Defaults to None.
- order_index -
The order index of the node. Defaults to -1.
This is an AST node, that can be called upon itself to traverse in a natural human way. Only
fname is an important argument, others will be populated automatically.
Get the docstring of the current node, is valid only for functions and classes. This will automatically perform relevant dedentation and return the docstring as a single string.
Returns a list of all the AST nodes (same
Astea) in the current node. This is a recursive function and user/bot is expected to go over this to traverse.
- x -
If provided, will find the name of the item to search for
- types -
The type of items to search for. Defaults to None.
Find all the instances of x in the current node, and return a list of IndexItems.
- if there is a '.' (dot) in
findwill try to perform a recursive search, you can escape the dot with a backslash
- This currently does not work correctly when the same name is used in different types
- if both
typesis not provided, then this behaves just like
List['Astea']: A list of IndexItems that match the search