def twm(self, diff, base):
        assert(self == base)
        numRemoved, numAdded = struct.unpack("!HH", diff[0:4])
        i = 4

        for x in xrange(numRemoved + numAdded):
            i, (typeId, s) = pack.unpack("!BD", i, diff)
            item = self.streamDict[typeId](s)
            if x < numRemoved:
                l = self._items[typeId]
                del l[l.index(item)]
            else:
                self._items[typeId].append(item)
dataset/ETHPy150Open sassoftware/conary/conary/streams.py/OrderedStreamCollection.twm/original