# Desktop Python teaching example. Numerical inputs are illustrative.
def arbitrate(*, fresh, hazard, elapsed_s, arrived):
    if hazard:
        return "STOP_HAZARD"
    if not fresh:
        return "STOP_INVALID"
    if elapsed_s >= 60:
        return "STOP_TIMEOUT"
    if arrived:
        return "STOP_ARRIVED"
    return "FOLLOW"

for case in [(True, True, 2, True), (False, False, 2, False),
             (True, False, 60, False), (True, False, 2, True)]:
    fresh, hazard, elapsed, arrived = case
    print(arbitrate(fresh=fresh, hazard=hazard, elapsed_s=elapsed, arrived=arrived))
