code: def _validator(key, val, env):
      
      if not env[key] in (True, False):
          raise SCons.Errors.UserError(
              'Invalid value for boolean option %s: %s' % (key, env[key]))
docs: Validates the given value to be either '0' or '1'.
      
      This is usable as 'validator' for SCons' Variables.