def test_bit(int_type, offset):
    """
    testBit() returns True if the bit at 'offset' is one.
    From http://wiki.python.org/moin/BitManipulation
    """
    mask = 1 << offset
    return bool(int_type & mask)
