def main():
    args = parse_args()
    docker_client = get_docker_client()

    running_mesos_task_ids = [task["id"] for task in mesos_tools.filter_running_tasks(
        mesos_tools.get_running_tasks_from_active_frameworks(''))]
    running_mesos_docker_containers = get_running_mesos_docker_containers()

    orphaned_containers = []
    for container in running_mesos_docker_containers:
        mesos_task_id = mesos_tools.get_mesos_id_from_container(
            container=container, client=docker_client)
        if running_mesos_task_ids not in mesos_task_id:
            orphaned_containers.append((container["Names"][0], mesos_task_id))

    if orphaned_containers:
        print "CRIT: Docker containers are orphaned: %s%s" % (", ".join(
            "%s (%s)" % (container_name, mesos_task_id)
            for container_name, mesos_task_id in orphaned_containers
        ), " and will be killed" if args.force else "")
        if args.force:
            for container_name, mesos_task_id in orphaned_containers:
                docker_client.kill(container_name)
        sys.exit(1)
    else:
        print "OK: All mesos task IDs accounted for"
        sys.exit(0)
dataset/ETHPy150Open Yelp/paasta/paasta_tools/contrib/kill_orphaned_docker_containers.py/main/swapped operands of `not in`