code: def unpack_int(s):
      
      ret = 0
      i = 0
      while True:
          b = ord(s[i])
          ret |= (b & 127) << (i * 7)
          i += 1
          if b & 128 == 0:
              break
      return ret
docs: Reads a packed integer from string <s>