(enable=True)
| 9 | |
| 10 | @contextmanager |
| 11 | def flop_counter(enable=True): |
| 12 | try: |
| 13 | old_flop_counter = state.flop_counter |
| 14 | state.flop_counter = FlopCounter() if enable else None |
| 15 | yield state.flop_counter |
| 16 | finally: |
| 17 | state.flop_counter = old_flop_counter |
| 18 | |
| 19 | |
| 20 | class FlopCounter: |
nothing calls this directly
no test coverage detected