#NEWLINE# def get_dataset_dir( dataset_name , data_dir = None , folder = None , create_dir = True ) : #NEWLINE# #INDENT# if ( not data_dir ) : #NEWLINE# #INDENT# data_dir = os . getenv ( 'SKLEARN_THEANO_DATA' , os . path . join ( os . path . expanduser ( '~' ) , 'sklearn_theano_data' ) ) #NEWLINE# #UNINDENT# if ( data_dir is None ) : #NEWLINE# #INDENT# data_dir = os . path . join ( data_dir , dataset_name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# data_dir = os . path . join ( data_dir , folder ) #NEWLINE# #UNINDENT# if ( ( not os . path . exists ( data_dir ) ) and create_dir ) : #NEWLINE# #INDENT# os . makedirs ( data_dir ) #NEWLINE# #UNINDENT# return data_dir