code: def leb128_decode(data):
          
          result = 0
          shift = 0
  
          while True:
              character = data.read(1)
              if len(character) == 0:
                  raise bitcoin.core.SerializationTruncationError('Invalid LEB128 integer')
  
              b = ord(character)
              result |= (b & 0x7f) << shift
              if b & 0x80 == 0:
                  break
              shift += 7
          return result
docs: Decodes a LEB128-encoded unsigned integer.
  
          :param BufferedIOBase data: The buffer containing the LEB128-encoded integer to decode.
          :return: The decoded integer.
          :rtype: int