module documentation

Utilities for type inference module

Class FuncCallVisitor A NodeVisitor class for getting function call information
Class TypeInferCallTransformer A NodeTransformer class for getting function call information
Function check_consistent_list_types Checks a list of values to see if they have a constant type
Function find_class_by_attr Undocumented
Function generate_ast Generates ast from the source string
Function get_api_ref_id Undocumented
Function get_attr_name Undocumented
Function get_built_in_types Gets Python built in types
Function get_func_calls_type Undocumented
Function get_function_comment Get the function comment header for function source code
Function get_type Get the type of a node
Function is_camel_case Determines whether a string is written in camel case
Function is_done Determines whether a list of type values is in a finished state
Function is_imported_fun Determines whether a function is imported from another library
Function is_valid_call_link Undocumented
Function parse_module Get the function, class and import nodes for a module
Function rename_from_name Undocumented
Function resolve_name Resolve the string name of an AST node
Variable built_in_func_type Undocumented
Variable func_ret_types Undocumented
def check_consistent_list_types(values) -> str: (source)

Checks a list of values to see if they have a constant type

def find_class_by_attr(module_records, attrs): (source)

Undocumented

def generate_ast(source: str): (source)

Generates ast from the source string

def get_api_ref_id(import_nodes): (source)

Undocumented

def get_attr_name(node): (source)

Undocumented

def get_built_in_types() -> Dict: (source)

Gets Python built in types

Returns
DictPython built in types in a dictionary
def get_func_calls_type(tree): (source)

Undocumented

def get_function_comment(source: str) -> str: (source)

Get the function comment header for function source code

Parameters
source:strThe function source code to check
Returns
strThe function header comment
def get_type(node, imports=None) -> str: (source)

Get the type of a node

Parameters
nodeThe node to get the type of
importsDictionary of known imported types
Returns
strThe type of the node
def is_camel_case(s: str) -> bool: (source)

Determines whether a string is written in camel case

Parameters
s:strThe string to check
Returns
boolTrue if the string is camel case, False otherwise
def is_done(t_vals: List[str]) -> bool: (source)

Determines whether a list of type values is in a finished state

Parameters
t_vals:List[str]List of type values to check
Returns
boolTrue if in a finished state, False otherwise
def is_imported_fun(func_name: str, import_dict: dict) -> Optional[str]: (source)

Determines whether a function is imported from another library

Parameters
func_name:strThe name of the function to check
import_dict:dictDictionary of import modules
Returns
Optional[str]The module that the function was import from or None if it was not imported
def is_valid_call_link(t_vals): (source)

Undocumented

def parse_module(m_ast): (source)

Get the function, class and import nodes for a module

Parameters
m_astThe AST tree to get the nodes for
Returns
Tuple containing list of function nodes, list of class nodes and list of import nodes
def rename_from_name(from_where, from_name, fun_name): (source)

Undocumented

def resolve_name(node: any) -> Union[str, None]: (source)

Resolve the string name of an AST node

built_in_func_type = (source)

Undocumented

func_ret_types: dict[str, str] = (source)

Undocumented