(self, model)
return model
Add failed-validation message to model
Add failed-validation message to model
Add failed - validation message to model
def validate_notebook_model(self, model):
        """Add failed-validation message to model"""
        try:
            validate_nb(model['content'])
        except ValidationError as e:
            model['message'] = u'Notebook validation failed: {}:\n{}'.format(
                e.message, json.dumps(e.instance, indent=1, default=lambda obj: '<UNKNOWN>'),
            )
        return model
def validate_notebook_model ( self , model ) : try : validate_nb ( model [ 'content' ] ) except ValidationError as e : model [ 'message' ] = u'Notebook validation failed: {}:\n{}' . format ( e . message , json . dumps ( e . instance , indent = 1 , default = lambda obj : '<UNKNOWN>' ) , ) return model