def validate_boolean(option, value):
 if isinstance(value, bool):
  return value
 raise TypeError(('%s must be True or False' % (option,)))

def validate_boolean ( option , value ) : if isinstance ( value , bool ) : return value raise TypeError ( ( '%s must be True or False' % ( option , ) ) )
check/normalize boolean settings: true: 1 .