@celery.task()
def finalize_broken_launches():
    log.debug("Finalize broke launches...")

    def is_finished(launch):
        log.debug("Check {} is finished".format(launch))
        for k, v in iter(launch.get_tasks().items()):
            res = celery.result.AsyncResult(k)
            if res.state == CELERY_FINISHED_STATES:
                return False
        return True

    def process(launch):
        if is_finished(launch):
            finalize_launch(launch.id)
        return launch

    return list(map(process, Launch.objects.filter(state__exact=0)))
dataset/ETHPy150Open 2gis/badger-api/testreport/tasks.py/finalize_broken_launches/operator `not in` -> `==`