def wait_for_job_status(client, run_id, timeout, status_to_check='succeeded'):
    response = None
    try:
        response = client.wait_for_run_completion(run_id, timeout)
    except TimeoutError:
        print(f'run-id: {run_id} did not stop within specified timeout')
        response = client.get_run(run_id)
    status = False
    if (response and response.run.status):
        status = (response.run.status.lower() == status_to_check)
    return status
def wait_for_job_status(client, run_id, timeout, status_to_check='succeeded'):
    response = None
    try:
        response = client.wait_for_run_completion(run_id, timeout)
    except TimeoutError:
        print(f'run-id: {run_id} did not stop within specified timeout')
        response = client.get_run(run_id)
    status = False
    if (response and response.run.status):
        status = (response.run.status.lower() == status_to_check)
    return status