code: def _readue(self, pos):
          
          oldpos = pos
          try:
              while not self[pos]:
                  pos += 1
          except IndexError:
              raise ReadError("Read off end of bitstring trying to read code.")
          leadingzeros = pos - oldpos
          codenum = (1 << leadingzeros) - 1
          if leadingzeros > 0:
              if pos + leadingzeros + 1 > self.len:
                  raise ReadError("Read off end of bitstring trying to read code.")
              codenum += self._readuint(leadingzeros, pos + 1)
              pos += leadingzeros + 1
          else:
              assert codenum == 0
              pos += 1
          return codenum, pos
docs: Return interpretation of next bits as unsigned exponential-Golomb code.
  
          Raises ReadError if the end of the bitstring is encountered while
          reading the code.