def validate_bool_kwarg(value, arg_name):
 if (not (is_bool(value) or (value is None))):
  raise ValueError(('For argument "%s" expected type bool, received type %s.' % (arg_name, type(value).__name__)))
 return value

def validate_bool_kwarg ( value , arg_name ) : if ( not ( is_bool ( value ) or ( value is None ) ) ) : raise ValueError ( ( 'For argument "%s" expected type bool, received type %s.' % ( arg_name , type ( value ) . __name__ ) ) ) return value
ensures that argument passed in arg_name is of type bool .