def _validated_param(obj, name, base_class, default, base_class_name=None):
 base_class_name = (base_class_name if base_class_name else base_class.__name__)
 if ((obj is not None) and (not isinstance(obj, base_class))):
  raise ValueError(u'{name} must be an instance of {cls}'.format(name=name, cls=base_class_name))
 return (obj or default)

def _validated_param ( obj , name , base_class , default , base_class_name = None ) : base_class_name = ( base_class_name if base_class_name else base_class . __name__ ) if ( ( obj is not None ) and ( not isinstance ( obj , base_class ) ) ) : raise ValueError ( u'{name} must be an instance of {cls}' . format ( name = name , cls = base_class_name ) ) return ( obj or default )
validates a parameter passed to __init__ .