<s> from __future__ import absolute_import <EOL> import os . path <EOL> import wtforms <EOL> from wtforms import validators <EOL> from . . forms import ImageDatasetForm <EOL> from digits import utils <EOL> from digits . utils . forms import validate_required_iff <EOL> class GenericImageDatasetForm ( ImageDatasetForm ) : <EOL> """<STR_LIT>""" <EOL> method = wtforms . SelectField ( u'<STR_LIT>' , <EOL> choices = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] , <EOL> default = '<STR_LIT>' , <EOL> ) <EOL> def validate_lmdb_path ( form , field ) : <EOL> if not field . data : <EOL> pass <EOL> else : <EOL> if not os . path . exists ( field . data ) or not os . path . isdir ( field . data ) : <EOL> raise validators . ValidationError ( '<STR_LIT>' ) <EOL> def validate_file_path ( form , field ) : <EOL> if not field . data : <EOL> pass <EOL> else : <EOL> if not os . path . exists ( field . data ) or not os . path . isfile ( field . data ) : <EOL> raise validators . ValidationError ( '<STR_LIT>' ) <EOL> prebuilt_train_images = wtforms . StringField ( '<STR_LIT>' , <EOL> validators = [ <EOL> validate_required_iff ( method = '<STR_LIT>' ) , <EOL> validate_lmdb_path , <EOL> ] <EOL> ) <EOL> prebuilt_train_labels = wtforms . StringField ( '<STR_LIT>' , <EOL> validators = [ <EOL> validate_lmdb_path , <EOL> ] <EOL> ) <EOL> prebuilt_val_images = wtforms . StringField ( '<STR_LIT>' , <EOL> validators = [ <EOL> validate_lmdb_path , <EOL> ] <EOL> ) <EOL> prebuilt_val_labels = wtforms . StringField ( '<STR_LIT>' , <EOL> validators = [ <EOL> validate_lmdb_path , <EOL> ] <EOL> ) <EOL> force_same_shape = utils . forms . SelectField ( '<STR_LIT>' , <EOL> choices = [ <EOL> ( <NUM_LIT:1> , '<STR_LIT>' ) , <EOL> ( <NUM_LIT:0> , '<STR_LIT>' ) , <EOL> ] , <EOL> coerce = int , <EOL> default = <NUM_LIT:1> , <EOL> tooltip = '<STR_LIT>' <EOL> ) <EOL> prebuilt_mean_file = utils . forms . StringField ( '<STR_LIT>' , <EOL> validators = [ <EOL> validate_file_path , <EOL> ] , <EOL> tooltip = "<STR_LIT>" <EOL> ) </s>
