def create_generic_db(jobs_dir, dataset_id, stage):
 if (jobs_dir == 'none'):
  jobs_dir = digits.config.config_value('jobs_dir')
 dataset_dir = os.path.join(jobs_dir, dataset_id)
 if (not os.path.isdir(dataset_dir)):
  raise IOError(('Dataset dir %s does not exist' % dataset_dir))
 dataset = Job.load(dataset_dir)
 extension_id = dataset.extension_id
 extension_class = extensions.data.get_extension(extension_id)
 extension = extension_class(**dataset.extension_userdata)
 feature_encoding = dataset.feature_encoding
 label_encoding = dataset.label_encoding
 batch_size = dataset.batch_size
 num_threads = dataset.num_threads
 force_same_shape = dataset.force_same_shape
 db_creator = DbCreator()
 db_creator.create_db(extension, stage, dataset_dir, batch_size, num_threads, feature_encoding, label_encoding, force_same_shape)
 logger.info('Generic DB creation Done')

def create_generic_db ( jobs_dir , dataset_id , stage ) : if ( jobs_dir == 'none' ) : jobs_dir = digits . config . config_value ( 'jobs_dir' ) dataset_dir = os . path . join ( jobs_dir , dataset_id ) if ( not os . path . isdir ( dataset_dir ) ) : raise IOError ( ( 'Dataset dir %s does not exist' % dataset_dir ) ) dataset = Job . load ( dataset_dir ) extension_id = dataset . extension_id extension_class = extensions . data . get_extension ( extension_id ) extension = extension_class ( ** dataset . extension_userdata ) feature_encoding = dataset . feature_encoding label_encoding = dataset . label_encoding batch_size = dataset . batch_size num_threads = dataset . num_threads force_same_shape = dataset . force_same_shape db_creator = DbCreator ( ) db_creator . create_db ( extension , stage , dataset_dir , batch_size , num_threads , feature_encoding , label_encoding , force_same_shape ) logger . info ( 'Generic DB creation Done' )
create a generic db .