def check_integrity(models):
 messages = dict(error=[], warning=[])
 for model in models:
  validators = []
  for name in dir(model):
   if (not name.startswith('_check')):
    continue
   obj = getattr(model, name)
   if getattr(obj, 'validator_type', None):
    validators.append(obj)
  for func in validators:
   messages[func.validator_type].extend(func())
 for msg in sorted(messages['error']):
  logger.error(('E-%d (%s): %s: %s' % msg))
 for msg in sorted(messages['warning']):
  logger.warning(('W-%d (%s): %s: %s' % msg))

def check_integrity ( models ) : messages = dict ( error = [ ] , warning = [ ] ) for model in models : validators = [ ] for name in dir ( model ) : if ( not name . startswith ( '_check' ) ) : continue obj = getattr ( model , name ) if getattr ( obj , 'validator_type' , None ) : validators . append ( obj ) for func in validators : messages [ func . validator_type ] . extend ( func ( ) ) for msg in sorted ( messages [ 'error' ] ) : logger . error ( ( 'E-%d (%s): %s: %s' % msg ) ) for msg in sorted ( messages [ 'warning' ] ) : logger . warning ( ( 'W-%d (%s): %s: %s' % msg ) )
apply validation and integrity checks to a collection of bokeh models .