<s> '''<STR_LIT>''' <EOL> from jsonschema . validators import Draft4Validator <EOL> from brain . schema . jsonschema_definition import jsonschema_string <EOL> class Validate_Dataset ( object ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , data , svm_session = None ) : <EOL> '''<STR_LIT>''' <EOL> self . data = data <EOL> self . svm_session = svm_session <EOL> self . list_error = [ ] <EOL> def validate_label ( self ) : <EOL> '''<STR_LIT>''' <EOL> try : <EOL> Draft4Validator ( jsonschema_string ( ) ) . validate ( { '<STR_LIT:value>' : self . data } ) <EOL> except Exception , error : <EOL> self . list_error . append ( str ( error ) ) <EOL> def validate_value ( self ) : <EOL> '''<STR_LIT>''' <EOL> try : <EOL> float ( self . data ) <EOL> except Exception , error : <EOL> self . list_error . append ( str ( error ) ) <EOL> def get_errors ( self ) : <EOL> '''<STR_LIT>''' <EOL> if len ( self . list_error ) > <NUM_LIT:0> : <EOL> return self . list_error <EOL> else : <EOL> return None </s>
