def instance(self, typeid):
        used_bits = self._buffer.used_bits()
        self._markers.append({'at':self.used_bits(),'type':'instance(%i)'%typeid})
        old_json = self._json
        self._json = {'bit_start': self.used_bits(), 'typeid': typeid}
        if typeid >= len(self._typeinfos):
            return {"ERROR":"Asked to instance typeid '%i' but there are only '%i' type IDs" % (typeid, len(self._typeinfos)), "hex": hex_string }
        typeinfo = self._typeinfos[typeid]
        retval = getattr(self, typeinfo[0])(*typeinfo[1])
        self._json['bit_end']  = self.used_bits()
        old_json[self.used_bits()%'instance%i'] = self._json
        self._json = old_json
        self._markers.append({'at':self.used_bits(),'type':'end-instance(%i)'%typeid})
        return retval
dataset/ETHPy150Open karlgluck/heroes-of-the-storm-replay-parser/s2protocol/decoders.py/BitPackedDecoderDebug.instance/swapped operands of `%`