service.py

changeset 100
9b5e6b5e5e0b
parent 99
0726eb9bc9d1
child 101
70d16b5e14ca
equal deleted inserted replaced
99:0726eb9bc9d1 100:9b5e6b5e5e0b
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),

mercurial