Parses a boolean value and returns its inverse.

 @param value [ String ] The URI option value.

 @return [ true | false | nil ] The inverse of the  boolean value parsed out, otherwise nil
   (and a warning will be logged).
420676
def inverse_bool(name, value)
      b = convert_bool(name, value)

      if b.nil?
        nil
      else
        !b
      end
    end
1221200
def convert_bool(string):
    
    if string == 'True':
        return True, True
    elif string == 'False':
        return True, False
    else:
        return False, False
1142666
function boolean(value) {
  var parsedBoolean = json(value);

  // handle 0|1 case
  if (typeOf(parsedBoolean) == 'number' && [0, 1].indexOf(parsedBoolean) > -1) {
    parsedBoolean = parsedBoolean === 0 ? false : true;
  }

  // couldn't parse it
  if (typeOf(parsedBoolean) != 'boolean') {
    return throwModifierError('boolean', value, {message: 'Invalid Boolean'});
  }

  return parsedBoolean;
}
408346
public static final Boolean parseExtendedAttributeBoolean(String value)
   {
      return ((value.equals("1") ? Boolean.TRUE : Boolean.FALSE));
   }
27878
def parse_bool(name, value)
      if ['1', 'true', 'enabled'].include?(value.downcase)
        true
      elsif ['0', 'false'].include?(value.downcase)
        false
      else
        raise ArgumentError.new("#{value} is not a valid boolean for #{name.to_s.upcase}")
      end
    end
3925
def as_boolean(value)
      res = false

      if value
        if value.is_a?(TrueClass) || value.is_a?(FalseClass)
          res = value
        elsif value.is_a?(Fixnum)
          res = value != 0
        elsif value.respond_to?(:to_s)
          value = value.to_s.downcase

          res = (value == 't' || value == 'true')
        end
      end

      res
    end
888761
public static boolean getBoolean(JSONValue value) {
        if (value == null)
            return false;
        if (!(value instanceof JSONBoolean))
            throw new JSONException(NOT_A_BOOLEAN);
        return ((JSONBoolean)value).booleanValue();
    }
899371
public static boolean getBooleanValue(CmsObject cms, I_CmsWidgetParameter value) {

        boolean result;
        if (value instanceof CmsXmlBooleanValue) {
            // this is a "native" boolean type
            result = ((CmsXmlBooleanValue)value).getBooleanValue();
        } else {
            // get the boolean value from the String value
            result = getBooleanValue(value.getStringValue(cms));
        }
        return result;
    }
1028331
def encode(cls, value):
        
        if value not in [True, False]:
            raise InvalidValue('not a boolean')

        return b'1' if value else b''
459610
protected Boolean eval(final Object... _value)
    {
        final Boolean ret;
        if (_value == null) {
            ret = null;
        } else if (_value[0] instanceof String) {
            ret = Boolean.valueOf((String) _value[0]);
        } else if (_value[0] instanceof Boolean) {
            ret = (Boolean) _value[0];
        } else  {
            ret = false;
        }
        return ret;
    }
1103342
function Boolean(value) {
	spec.Asn1Spec.call(this, new spec.Asn1Tag(spec.TagClass.Universal, spec.TagFormat.Primitive, UniversalTag.Boolean));
	this.value = value || false;
}
293657
private boolean parseBoolean(String s) {
        if ( "1".equals(s) ) {
            return true;
        } else if ( "0".equals(s) ) {
            return false;
        } else {
            throw new IllegalArgumentException("Expected 1 or 0 for boolean value, was " + s);
        }
    }
696420
public static boolean toBoolean(String value, boolean defaultValue)
    {
        return "true".equals(value) ? true : ("false".equals(value) ? false : defaultValue);
    }
399368
public static Boolean parseBoolean(String value) throws ParseException
   {
      Boolean result = null;
      Integer number = parseInteger(value);
      if (number != null)
      {
         result = number.intValue() == 0 ? Boolean.FALSE : Boolean.TRUE;
      }

      return result;
   }
1327979
def boolean(value):
    
    if isinstance(value, bool):
        return value

    if value == "":
        return False

    return strtobool(value)
312553
def _parse_boolean(value, default=False):
    
    if value is None:
        return default
    try:
        return bool(value)
    except ValueError:
        return default
470972
def parse_bool(val):
    
    true_vals = ('t', 'true', 'yes', 'y', '1', 'on')
    false_vals = ('f', 'false', 'no', 'n', '0', 'off')

    val = val.lower()
    if val in true_vals:
        return True
    if val in false_vals:
        return False

    raise ValueError('"%s" is not a valid bool value' % val)