code: def _parse_sv8_int(fileobj, limit=9):
      
  
      num = 0
      for i in xrange(limit):
          c = fileobj.read(1)
          if len(c) != 1:
              raise EOFError
          c = bytearray(c)
          num = (num << 7) | (c[0] & 0x7F)
          if not c[0] & 0x80:
              return num, i + 1
      if limit > 0:
          raise ValueError
      return 0, 0
docs: Reads (max limit) bytes from fileobj until the MSB is zero.
      All 7 LSB will be merged to a big endian uint.
  
      Raises ValueError in case not MSB is zero, or EOFError in
      case the file ended before limit is reached.
  
      Returns (parsed number, number of bytes read)