class documentation

class AstManager(BaseManager): (source)

Known subclasses: klara.klara_z3.cov_manager.CovManager

View In Hierarchy

An ast manager. Responsible for: - building and caching builtins tree depends on python version, - managing the protocol of python operation between python 2/3. - managing registering and executing transformation to the tree - load default and user specifies extension file, stub file

Method __init__ Undocumented
Method add_weak_ref Undocumented
Method apply_transform Undocumented
Method bootstrap_builtins Construct builtin class type (e.g. int, float) in ast form This will need to only parse builtins.pyi for the class definition, and construct the class with appropriate locals method with the return type.
Method build_tree Undocumented
Method dump_infer Undocumented
Method infer_wrapper optional wrapper around infer()
Method initialize Initialize all required process for analysis.
Method load_default_extension Undocumented
Method load_default_stub_files Undocumented
Method load_extension simply import the file_obj since it's python file. But do some bookkeeping for printing purpose :param file_path: the file path in string to import :return: None
Method load_user_extension Undocumented
Method make_z3_var make a z3 field for python variable
Method reload_protocol reload all necessary protocol based on config reload the dunder method based on py_version in config
Method temp_manager save the manager state and restore it after the operation.
Method uninitialize Undocumented
Method unload_all_extensions Undocumented
Constant BUILTINS_FILE Undocumented
Instance Variable __dict__ Undocumented
Instance Variable built_tree Undocumented
Instance Variable builtins_tree Undocumented
Instance Variable config Undocumented
Instance Variable loaded_extension Undocumented
Instance Variable loaded_modules Undocumented
Instance Variable register_transform Undocumented
Instance Variable transform Undocumented
Instance Variable unregister_transform Undocumented
Instance Variable weakrefs Undocumented
Instance Variable z3var_maps Undocumented
Method _fresh_init Undocumented
Method _reload_protocol Undocumented
Instance Variable _ast_manager_status Undocumented

Inherited from BaseManager:

Method clear_infer_cache Undocumented
Method get_infer_statistics Undocumented
Method reset Undocumented
Instance Variable builtins_ast_cls Undocumented
Instance Variable infer_cache Undocumented
Instance Variable infer_count Undocumented
Instance Variable logger Undocumented
Instance Variable skipped_infer_count Undocumented
Instance Variable skipped_same_operand_count Undocumented
Instance Variable skipped_same_operand_nested_count Undocumented
Instance Variable skipped_z3_operand Undocumented
Constant _LOG_METHOD_REPR Undocumented
Constant _VERBOSITY_LEVEL Undocumented
Class Variable _core Undocumented
Instance Variable _manager_status Undocumented
def __init__(self, config=None): (source)
def add_weak_ref(self, obj): (source)

Undocumented

def apply_transform(self, tree): (source)

Undocumented

def bootstrap_builtins(self): (source)

Construct builtin class type (e.g. int, float) in ast form This will need to only parse builtins.pyi for the class definition, and construct the class with appropriate locals method with the return type.

def build_tree(self, ast_str, name='', tree_rewriter=None): (source)

Undocumented

def dump_infer(self, node, results, len_after): (source)

Undocumented

def infer_wrapper(self, func): (source)

optional wrapper around infer()

def initialize(self, config=None): (source)

Initialize all required process for analysis.

def load_default_extension(self): (source)

Undocumented

def load_default_stub_files(self): (source)

Undocumented

def load_extension(self, file_path): (source)

simply import the file_obj since it's python file. But do some bookkeeping for printing purpose :param file_path: the file path in string to import :return: None

Parameters
file_path:strUndocumented
def load_user_extension(self): (source)

Undocumented

def make_z3_var(self, var, t): (source)

make a z3 field for python variable

Parameters
var:strUndocumented
tUndocumented
def reload_protocol(self): (source)

reload all necessary protocol based on config reload the dunder method based on py_version in config

@contextlib.contextmanager
def temp_manager(self): (source)

save the manager state and restore it after the operation.

def unload_all_extensions(self): (source)

Undocumented

BUILTINS_FILE: str = (source)

Undocumented

Value
'typeshed/stdlib/2and3/builtins.pyi'
built_tree = (source)

Undocumented

loaded_extension = (source)

Undocumented

loaded_modules: list = (source)

Undocumented

register_transform = (source)

Undocumented

transform = (source)

Undocumented

unregister_transform = (source)

Undocumented

weakrefs: list = (source)

Undocumented

z3var_maps: dict = (source)

Undocumented

def _fresh_init(self, config=None): (source)
def _reload_protocol(self, py2=False): (source)

Undocumented

_ast_manager_status: bool = (source)

Undocumented