#NEWLINE# def prompt_user( prompt ) : #NEWLINE# #INDENT# 'Ask user for agreeing to data set licenses.' #NEWLINE# yes = set ( [ 'yes' , 'y' ] ) #NEWLINE# no = set ( [ 'no' , 'n' ] ) #NEWLINE# try : #NEWLINE# #INDENT# print ( prompt ) #NEWLINE# choice = raw_input ( ) . lower ( ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# print ( 'Stdin is not implemented.' ) #NEWLINE# print ( 'You need to set' ) #NEWLINE# print ( 'overide_manual_authorize=True' ) #NEWLINE# print ( 'to proceed with the download. Please set that variable and continue.' ) #NEWLINE# raise #NEWLINE# #UNINDENT# if ( choice in yes ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( choice in no ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( ( 'Your response was a ' + choice ) ) #NEWLINE# print ( "Please respond with 'yes', 'y' or 'no', 'n'" )