def next_power_of_2(number):
    """ Returns the next power of 2. """
    if number <= 0:
        return 1

    bit_len = int.bit_length(number)
    power2 = 2 ** (bit_len - 1)

    if power2 == number:
        return number
    else:
        return power2 * 2