Module Expr Str Import alias Import alias Import alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str Pass decorator_list ClassDef bases NameLoad AttributeLoad NameLoad attr body Expr Str Pass decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad For TupleStore NameStore TupleStore NameStore NameStore NameStore NameStore NameStore Call NameLoad Call AttributeLoad NameLoad attr body For NameStore NameLoad body Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Call NameLoad body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore NameStore NameLoad Assign TupleStore NameStore NameStore NameStore NameStore NameStore SubscriptLoad NameLoad Index NameLoad Return Dict Str Str Str Str Str Str Str Str NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad ListComp Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad comprehension NameStore SubscriptLoad NameLoad Index NameLoad CompareNotIn NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign TupleStore NameStore NameStore NameLoad Return SubscriptLoad NameLoad Index Num decorator_list Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Import alias Expr Call AttributeLoad NameLoad attr TryExcept body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Str handlers ExceptHandler type NameLoad body Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr ExceptHandler type NameLoad body Pass Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body With Call NameLoad AttributeLoad NameLoad attr Str NameStore body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Pass Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Import alias Expr Call AttributeLoad NameLoad attr TryFinally body TryExcept body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Str handlers ExceptHandler type NameLoad body Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr ExceptHandler type NameLoad body Pass finalbody Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpMod Str AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign SubscriptStore AttributeLoad NameLoad attr Slice ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign SubscriptStore AttributeLoad NameLoad attr Slice ListLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Expr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Dict Str Str Str Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list
N/A N/A Module for runtime profiling. N/A cProfile N/A pstats N/A sys collections defaultdict vprof base_profile Error N/A Exception N/A N/A Base exception for current module. N/A N/A RuntimeProfilerRunError N/A Error N/A base_profile ProfilerRuntimeException N/A N/A Runtime exception for runtime profiler. N/A N/A RuntimeProfile N/A N/A base_profile BaseProfile N/A N/A CProfile wrapper.

    This class contains all logic related to cProfile run, stats collection
    and processing. All function call info is contained in stats.Pstats, all
    we have to do is to run cProfile and build call tree from resulting
    pstats.Stats.
     _build_callees N/A N/A self stats N/A N/A N/A Extracts call tree from pstats.Stats. N/A callees N/A defaultdict list N/A N/A func N/A _ _ _ _ callers N/A sorted N/A N/A stats items N/A N/A caller callers N/A N/A N/A N/A N/A callees N/A caller append func N/A callees N/A _build_call_tree N/A N/A self node callees stats seen N/A N/A set N/A N/A Builds call tree from callees tree and pstats.Stats.

        Args:
            node: Current call tree node.
            callees: Callees tree with call dependencies.
            stats: Profile stats.
            seen: Set to track previously seen nodes to handle recursion.
        Returns:
            A dict representing call tree with all necessary parameters.
         N/A N/A N/A seen add node N/A N/A module_name lineno func_name node N/A N/A cum_calls num_calls time_per_call cum_time _ N/A stats N/A node N/A N/A moduleName lineno funcName primCalls totalCalls timePerCall cumTime children module_name lineno func_name cum_calls num_calls time_per_call cum_time N/A N/A N/A self _build_call_tree child callees stats seen N/A child N/A callees N/A node N/A child seen N/A _transform_stats N/A N/A self stats N/A N/A N/A Converts stats from pststs.Stats format to call nested dict. _statcmp N/A N/A stat N/A N/A N/A Comparator by cummulative time. N/A N/A _ params stat N/A N/A params N/A 3 N/A N/A N/A N/A stats calc_callees N/A callees N/A N/A self _build_callees N/A stats stats N/A N/A root _ N/A max N/A N/A N/A stats stats items key _statcmp N/A N/A N/A self _build_call_tree root callees N/A stats stats N/A run_as_package_path N/A N/A self prof N/A N/A N/A Runs program as package specified with file path. N/A runpy N/A N/A N/A prof enable N/A N/A N/A N/A N/A runpy run_path N/A self _run_object run_name __main__ N/A N/A N/A ImportError N/A N/A N/A RuntimeProfilerRunError N/A Unable to run package %s N/A self _run_object N/A N/A SystemExit N/A N/A N/A N/A N/A prof disable N/A N/A self _object_name N/A self _run_object N/A run_as_module N/A N/A self prof N/A N/A N/A Runs program as module. N/A N/A N/A N/A open N/A self _run_object rb srcfile N/A N/A code N/A compile N/A N/A srcfile read N/A self _run_object exec N/A N/A N/A prof runctx code N/A self _globs None N/A N/A N/A SystemExit N/A N/A N/A N/A self _object_name N/A self _run_object N/A run_as_package_in_namespace N/A N/A self prof N/A N/A N/A Runs program as package in Python namespace. N/A runpy N/A N/A N/A prof enable N/A N/A N/A N/A N/A N/A N/A runpy run_module N/A self _run_object run_name __main__ N/A N/A N/A ImportError N/A N/A N/A RuntimeProfilerRunError N/A Unable to run package %s N/A self _run_object N/A N/A SystemExit N/A N/A N/A N/A N/A N/A prof disable N/A N/A self _object_name N/A self _run_object N/A run_as_function N/A N/A self prof N/A N/A N/A Runs object as function. N/A N/A N/A prof enable N/A N/A N/A self _run_object N/A self _run_args N/A self _run_kwargs N/A N/A N/A prof disable N/A N/A self _object_name N/A function %s N/A N/A self _run_object __name__ N/A run N/A N/A self N/A N/A N/A Collects CProfile stats for specified Python program. N/A N/A self _run_args N/A N/A N/A N/A sys argv N/A N/A N/A self _run_object N/A self _run_args N/A N/A N/A N/A sys argv N/A N/A N/A self _run_object N/A prof N/A N/A cProfile Profile N/A run_dispatcher N/A N/A self get_run_dispatcher N/A N/A run_dispatcher prof N/A N/A N/A prof create_stats N/A cprofile_stats N/A N/A pstats Stats prof N/A N/A programName runTime primitiveCalls totalCalls callStats N/A self _object_name N/A cprofile_stats total_tt N/A cprofile_stats prim_calls N/A cprofile_stats total_calls N/A N/A self _transform_stats cprofile_stats N/A N/A