368 else: |
368 else: |
369 break |
369 break |
370 return length or len(route) |
370 return length or len(route) |
371 from math import inf |
371 from math import inf |
372 def route_limit(route): |
372 def route_limit(route): |
373 return (route in night_routes) and 20 else 6 |
373 return (route in night_routes) and 20 or 6 |
374 def route_key(route): |
374 def route_key(route): |
375 from math import log |
375 from math import log |
376 return ( |
376 return ( |
377 route in night_routes, |
377 route in night_routes, |
378 counts_per_variant.get(route, 0) < route_limit(route), |
378 counts_per_variant.get(route, 0) < route_limit(route), |