code: def to_int(self):
          
          num = self.to_uint()
          if num and self._items[-1].unbox():
              return num - (1 << self.size)
          else:
              return num
docs: Convert vector to an integer, if possible.
  
          This is only useful for arrays filled with zero/one entries.