@timeout()
def wait_for_app_to_launch_tasks(client, app_id, expected_tasks, exact_matches_only=False):
    found = False
    while not found:
        try:
            found = app_has_tasks(client, app_id, expected_tasks, exact_matches_only)
        except NotFoundError:
            pass
        if found:
            return
        else:
            print "waiting for app %s to have %d tasks. retrying" % (app_id, expected_tasks)
            sleep(0.5)
Wait for an app to have num_tasks tasks launched. If the app isn't found, then this will swallow the exception
dataset/ETHPy150Open Yelp/paasta/paasta_tools/marathon_tools.py/wait_for_app_to_launch_tasks