MCPcopy Index your code
hub / github.com/python/cpython / calc_rare_event_table

Function calc_rare_event_table

Tools/scripts/summarize_stats.py:1365–1378  ·  view source on GitHub ↗
(stats: Stats)

Source from the content-addressed store, hash-verified

1363
1364def rare_event_section() -> Section:
1365 def calc_rare_event_table(stats: Stats) -> Table:
1366 DOCS = {
1367 "set class": "Setting an object's class, `obj.__class__ = ...`",
1368 "set bases": "Setting the bases of a class, `cls.__bases__ = ...`",
1369 "set eval frame func": (
1370 "Setting the PEP 523 frame eval function "
1371 "`_PyInterpreterState_SetFrameEvalFunc()`"
1372 ),
1373 "builtin dict": "Modifying the builtins, `__builtins__.__dict__[var] = ...`",
1374 "func modification": "Modifying a function, e.g. `func.__defaults__ = ...`, etc.",
1375 "watched dict modification": "A watched dict has been modified",
1376 "watched globals modification": "A watched `globals()` dict has been modified",
1377 }
1378 return [(Doc(x, DOCS[x]), Count(y)) for x, y in stats.get_rare_events()]
1379
1380 return Section(
1381 "Rare events",

Callers

nothing calls this directly

Calls 3

CountClass · 0.85
get_rare_eventsMethod · 0.80
DocClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…