#NEWLINE# def handle( self , **options ) : #NEWLINE# #INDENT# service = get_prediction_service ( ) #NEWLINE# train = service . training ( ) #NEWLINE# train . insert ( data = options [ 'file' ] , body = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) . execute ( ) #NEWLINE# log . info ( ( 'Started training %s' % options [ 'file' ] ) ) #NEWLINE# import time #NEWLINE# while True : #NEWLINE# #INDENT# status = train . get ( data = options [ 'file' ] ) . execute ( ) #NEWLINE# log . info ( status ) #NEWLINE# if ( 'RUNNING' != status [ 'trainingStatus' ] ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# log . info ( 'Waiting for training to complete.' ) #NEWLINE# time . sleep ( 2 ) #NEWLINE# #UNINDENT# log . info ( 'Training is complete' )