def upper_power_of_two(value) -> int:
    """Returns the value of 2 raised to some power which is the smallest
     such value that is just >= *value*."""
    result = 1
    while result < value:
        result <<= 1
    return result