[dependencies]
either = { version = "1.0", features = ["serde"] }
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def maxminlr(stalls_count, users_count): | |
order = users_count.bit_length() - 1 | |
pow_two = 2 ** order | |
k, p = divmod(stalls_count, pow_two * 2) | |
t = users_count | |
if p in range(0, t - pow_two): | |
return (k - 1, k - 1) | |
elif p in range(t - pow_two, t): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import i3pystatus.backlight as backlight | |
import os | |
import pytest | |
from contextlib import contextmanager | |
from operator import itemgetter | |
from tempfile import TemporaryDirectory | |