'Yields (container, obj) tuples to be deleted'

def iter_cont_objs_to_expire(self):

    obj_cache = {}
    cnt = 0
    all_containers = set()
    for c in self.swift.iter_containers(self.expiring_objects_account):
        container = str(c['name'])
        timestamp = int(container)
        if (timestamp > int(time())):
            break
        all_containers.add(container)
        for o in self.swift.iter_objects(self.expiring_objects_account, container):
            obj = o['name'].encode('utf8')
            (timestamp, actual_obj) = obj.split('-', 1)
            timestamp = int(timestamp)
            if (timestamp > int(time())):
                break
            try:
                (cust_account, cust_cont, cust_obj) = split_path(('/' + actual_obj), 3, 3, True)
                cache_key = ('%s/%s' % (cust_account, cust_cont))
            except ValueError:
                cache_key = None
            if (self.processes > 0):
                obj_process = int(hashlib.md5(('%s/%s' % (container, obj))).hexdigest(), 16)
                if ((obj_process % self.processes) != self.process):
                    continue
            if (cache_key not in obj_cache):
                obj_cache[cache_key] = []
            obj_cache[cache_key].append((container, obj))
            cnt += 1
            if (cnt > MAX_OBJECTS_TO_CACHE):
                while obj_cache:
                    for key in obj_cache.keys():
                        if obj_cache[key]:
                            (yield obj_cache[key].pop())
                            cnt -= 1
                        else:
                            del obj_cache[key]
    while obj_cache:
        for key in obj_cache.keys():
            if obj_cache[key]:
                (yield obj_cache[key].pop())
            else:
                del obj_cache[key]
    for container in all_containers:
        (yield (container, None))
