def get(self, **kwargs):
        for tried in count(0):  # for infinity
            resource = self._next()

            try:
                return self.fun(resource, **kwargs), resource
            except self.predicate:
                if tried >= len(self.resources) - 1:
                    raise
dataset/ETHPy150Open celery/kombu/kombu/utils/scheduling.py/FairCycle.get/original