

def _merge_iters(self, iterlist):
    current = []
    for it in iterlist:
        (fnum, text, docfreq, termcount) = it.next()
        current.append((fnum, text, docfreq, termcount, active))
    heapify(current)
    active = len(current)
    while (active > 0):
        (fnum, text) = current[0][:2]
        docfreq = 0
        termcount = 0
        while (current and (current[0][0] == fnum) and (current[0][1] == text)):
            docfreq += current[0][2]
            termcount += current[0][3]
            it = current[0][4]
            try:
                (fn, t, df, tc) = it.next()
                heapreplace(current, (fn, t, df, tc, it))
            except StopIteration:
                heappop(current)
                active -= 1
        (yield (fnum, text, docfreq, termcount))

dataset/ETHPy150Open dokipen/whoosh/src/whoosh/reading.py MultiReader._merge_iters/VarMisuse@53/65 `it`->`active`