@classmethod
    def _number_is_power_of_two(cls, x):
        # it turns out that x & (x - 1) == 0 if and only if x is a power of two
        # http://stackoverflow.com/a/600306/240553
        return x > 0 and (x & (x - 1) == 0)
dataset/ETHPy150Open dimagi/commcare-hq/corehq/util/cache_utils.py/ExponentialBackoff._number_is_power_of_two/original