code: def getbit(self, key, offset):
          
          key = self._encode(key)
          index, bits, mask = self._get_bits_and_offset(key, offset)
  
          if index >= len(bits):
              return 0
  
          return 1 if (bits[index] & mask) else 0
docs: Returns the bit value at ``offset`` in ``key``.