def op(self):
        # Fill up with any new iterables
        self.fill_iters()
        if self.it_final and not self.iters:
            # Done
            raise StopIteration
        # Make shuffled copy of iterables, need copy anyway due to iters modification inside loop
        iters_copy = self.iters
        random.shuffle(iters_copy)
        for elem in iters_copy:
            key, it = elem if self.keyed else (None, elem)
            try:
                e = it.next()
                return (key, e) if self.keyed else e
            except PauseIteration:
                continue
            except __HOLE__:
                self.iters.remove(elem)
                continue
        raise PauseIteration
dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/utilities/dynops.py/Collect.op