Developer Tools

PyPstats

Python stdlib module — pstats. Auto-indexed from CDN. Method-level security roles have not been annotated; rule writers should inspect the source before use.

Other Methods

.add_callers()Neutral
#
Signature
add_callers(target, source)

Combine two caller lists in a single list.

.add_func_stats()Neutral
#
Signature
add_func_stats(target, source)

Add together all the stats for two profile entries.

.cmp_to_key()Neutral
#
Signature
cmp_to_key()

Convert a cmp= function into a key= function.

.count_calls()Neutral
#
Signature
count_calls(callers)

Sum the caller statistics to get total number of calls received.

.dataclass()Neutral
#
Signature
dataclass(cls, init, repr, eq, order, unsafe_hash, frozen, match_args, kw_only, slots, weakref_slot)

Add dunder methods based on the fields defined in the class.

.f8()Neutral
#
Signature
f8(x)

f8 function.

.func_get_function_name()Neutral
#
Signature
func_get_function_name(func)

func_get_function_name function.

.func_std_string()Neutral
#
Signature
func_std_string(func_name)

func_std_string function.

.func_strip_path()Neutral
#
Signature
func_strip_path(func_name)

func_strip_path function.

.FunctionProfile()Neutral
#
Signature
FunctionProfile(...)

FunctionProfile(ncalls: str, tottime: float, percall_tottime: float, cumtime: float, percall_cumtime: float, file_name: str, line_number: int)

Fully-Qualified Names

FQNField
pstatsfqns[0]

Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.

Import

rule.py
import pstats