def wait_until_model_status_code_is(step, code1, code2, secs):
    start = datetime.utcnow()
    read.i_get_the_model(step, world.model['resource'])
    status = get_status(world.model)
    while (status['code'] != int(code1) and
           status['code'] != int(code2)):
           time.sleep(3)
           assert datetime.utcnow() - start < timedelta(seconds=int(secs))
           read.i_get_the_model(step, world.model['resource'])
           status = get_status(world.model)
    assert status['code'] == int(code1)

#@step(r'I wait until the model is ready less than (\d+)')
dataset/ETHPy150Open bigmlcom/python/bigml/tests/create_model_steps.py/wait_until_model_status_code_is/original