/opt/cloudlinux/venv/lib/python3.11/site-packages/guppy/etc
NameSizeModeActions
__pycache__/-0755rm
Cat.py40880644editdlrm
cmd.py150700644editdlrm
Code.py10560644editdlrm
Descriptor.py9030644editdlrm
etc.py16970644editdlrm
FSA.py73760644editdlrm
Glue.py140060644editdlrm
Help.py68730644editdlrm
IterPermute.py22730644editdlrm
KanExtension.py212050644editdlrm
KnuthBendix.py90230644editdlrm
RE.py241540644editdlrm
RE_Rect.py106350644editdlrm
textView.py31460644editdlrm
tkcursors.py21770644editdlrm
xterm.py23650644editdlrm
__init__.py870644editdlrm
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/guppy/etc/Code.py (1056B)
def co_code_findloadednames(co): """Find in the code of a code object, all loaded names. (by LOAD_NAME, LOAD_GLOBAL or LOAD_FAST) """ import dis from opcode import HAVE_ARGUMENT, opmap hasloadname = (opmap['LOAD_NAME'], opmap['LOAD_GLOBAL'], opmap['LOAD_FAST']) insns = dis.get_instructions(co) len_co_names = len(co.co_names) indexset = {} for insn in insns: if insn.opcode >= HAVE_ARGUMENT: if insn.opcode in hasloadname: indexset[insn.argval] = 1 if len(indexset) >= len_co_names: break for name in co.co_varnames: try: del indexset[name] except KeyError: pass return indexset def co_findloadednames(co): """Find all loaded names in a code object and all its consts of code type""" names = {} names.update(co_code_findloadednames(co)) for c in co.co_consts: if isinstance(c, type(co)): names.update(co_findloadednames(c)) return names