code: def read_bit(self):
          
          if not self.bitcount:
              self.bits = ord(self.input.read(1))
              self.bitcount = 8
          result = (self.bits & 1) == 1
          self.bits >>= 1
          self.bitcount -= 1
          return result
docs: Read a single boolean value.