code: def varint_to_int(vi):
      b = ord(vi[0])
      p = 1
      i = b & 0x7F
      shift = 7
      while b & 0x80 != 0:
          b = ord(vi[p])
          p += 1
          i |= (b & 0x7F) << shift
          shift += 7
      return i
  
file_path: whoosh/src/whoosh/util/varints.py
imports: from array import array
  from whoosh.compat import array_tobytes, xrange
label_desc: Use image node_id 3 for calling a global function with example usage: varint_to_int(vi) and returns: i