def assert_instance(obj, class_, label):
 if (not isinstance(obj, class_)):
  raise ModelInconsistencyError(('%s should be sublcass of %s, provided: %s' % (label, class_.__name__, type(obj).__name__)))

def assert_instance ( obj , class_ , label ) : if ( not isinstance ( obj , class_ ) ) : raise ModelInconsistencyError ( ( '%s should be sublcass of %s, provided: %s' % ( label , class_ . __name__ , type ( obj ) . __name__ ) ) )
raises argumenterror when obj is not instance of cls .