def is_power_of_two_brian_kernighan(number):
    """Checks whether a given integer is a power of 2

    It uses the Brian Kernighan algorithm used to count the set bits.
    We know that powers of 2 only have 1 set bit.
    e.g 2^0 = 1, 2^1= 10, 2^2= 100 ...

    By applying a bitwise & to the given integer and the next smallest integer
    if the the result is 0, then we know it is a power of 2. Otherwise it is not
    e.g Given 4:
    n = 4       => 100
    n -1 = 3    =>  11
    ---------------------
    &           => 0 True
    ---------------------

    n = 5       => 101
    n -1 = 3    => 100
    ---------------------
    &           => 001 False
    ---------------------

    Parameters
    ----------
    number : int
        positive integer

    Returns
    -------
    bool
        indicates whether the given number is a power of 2. e.g. True or False

    """
    if number == 0:
        return False
    return (number & (number - 1)) == 0