def _is_power_of_two(number):
  """Checks whether a number is power of 2.

  If a number is power of 2, all the digits of its binary are zero except for
  the leading digit.
  For example:
    1 -> 1
    2 -> 10
    4 -> 100
    8 -> 1000
    16 -> 10000

  All the digits after the leading digit are zero after subtracting 1 from
  number.
  For example:
    0 -> 0
    1 -> 1
    3 -> 11
    7 -> 111
    15 -> 1111

  Therefore, given a non-zero number, (number & (number - 1)) is zero
  if number is power of 2.

  Args:
    number: Integer.

  Returns:
    Boolean.
  """
  return number and not number & (number - 1)