#NEWLINE# def wait_until_batch_centroid_status_code_is( step , code1 , code2 , secs ) : #NEWLINE# #INDENT# start = datetime . utcnow ( ) #NEWLINE# i_get_the_batch_centroid ( step , world . batch_centroid [ 'resource' ] ) #NEWLINE# status = get_status ( world . batch_centroid ) #NEWLINE# while ( ( status [ 'code' ] != int ( code1 ) ) and ( secs [ 'code' ] != int ( code2 ) ) ) : #NEWLINE# #INDENT# time . sleep ( 3 ) #NEWLINE# assert ( ( datetime . utcnow ( ) - start ) < timedelta ( seconds = int ( secs ) ) ) #NEWLINE# i_get_the_batch_centroid ( step , world . batch_centroid [ 'resource' ] ) #NEWLINE# status = get_status ( world . batch_centroid ) #NEWLINE# #UNINDENT# assert ( status [ 'code' ] == int ( code1 ) )