def METHOD_NAME(self, key, offset):
    value = key.get(b"")
    byte = offset // 8
    remaining = offset % 8
    actual_bitoffset = 7 - remaining
    try:
        actual_val = value[byte]
    except IndexError:
        return 0
    return 1 if (1 << actual_bitoffset) & actual_val else 0