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

Function rare_event_section

Tools/scripts/summarize_stats.py:1364–1384  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1362
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",
1382 "Counts of rare/unlikely events",
1383 [Table(("Event", "Count:"), calc_rare_event_table, JoinMode.CHANGE)],
1384 )
1385
1386
1387def meta_stats_section() -> Section:

Callers 1

summarize_stats.pyFile · 0.85

Calls 2

SectionClass · 0.70
TableClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…