anti-flapping
State machine with confirmation hysteresis: anti-flapping for noisy classifiers. Pure Python, no dependencies.