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

Method get_pair_counts

Tools/scripts/summarize_stats.py:196–203  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

194 return self._data.keys()
195
196 def get_pair_counts(self) -> dict[tuple[str, str], int]:
197 pair_counts = {}
198 for name_i, opcode_stat in self._data.items():
199 for key, value in opcode_stat.items():
200 if value and key.startswith("pair_count"):
201 name_j, _, _ = key[len("pair_count") + 1 :].partition("]")
202 pair_counts[(name_i, name_j)] = value
203 return pair_counts
204
205 def get_total_execution_count(self) -> int:
206 return sum(x.get("execution_count", 0) for x in self._data.values())

Callers 2

_get_pred_succMethod · 0.95
calc_pair_count_tableFunction · 0.80

Calls 3

itemsMethod · 0.45
startswithMethod · 0.45
partitionMethod · 0.45

Tested by

no test coverage detected