(
self,
)
| 218 | |
| 219 | @functools.cache |
| 220 | def _get_pred_succ( |
| 221 | self, |
| 222 | ) -> tuple[dict[str, collections.Counter], dict[str, collections.Counter]]: |
| 223 | pair_counts = self.get_pair_counts() |
| 224 | |
| 225 | predecessors: dict[str, collections.Counter] = collections.defaultdict( |
| 226 | collections.Counter |
| 227 | ) |
| 228 | successors: dict[str, collections.Counter] = collections.defaultdict( |
| 229 | collections.Counter |
| 230 | ) |
| 231 | for (first, second), count in pair_counts.items(): |
| 232 | if count: |
| 233 | predecessors[second][first] = count |
| 234 | successors[first][second] = count |
| 235 | |
| 236 | return predecessors, successors |
| 237 | |
| 238 | def get_predecessors(self, opcode: str) -> collections.Counter[str]: |
| 239 | return self._get_pred_succ()[0][opcode] |
no test coverage detected