Extracts a boolean parameter from a CGI form, on the assumption that
    ``"1"`` is ``True`` and everything else is ``False``.
969397
def get_cgi_parameter_bool(form: cgi.FieldStorage, key: str) -> bool:
    
    return is_1(get_cgi_parameter_str(form, key))
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;
}
96433
public static final Boolean parseBoolean(String value)
   {
      return (value == null || value.charAt(0) != '1' ? Boolean.FALSE : Boolean.TRUE);
   }
1361907
def cgi_parameter_exists(form: cgi.FieldStorage, key: str) -> bool:
    
    s = get_cgi_parameter_str(form, key)
    return s is not None
312553
def _parse_boolean(value, default=False):
    
    if value is None:
        return default
    try:
        return bool(value)
    except ValueError:
        return default
1172354
def get_cgi_parameter_str(form: cgi.FieldStorage,
                          key: str,
                          default: str = None) -> str:
    
    paramlist = form.getlist(key)
    if len(paramlist) == 0:
        return default
    return paramlist[0]
758590
def bool(anon, obj, field, val):
    
    return anon.faker.bool(field=field)
560816
def get_as_boolean(self, key):
        
        value = self.get(key)
        return BooleanConverter.to_boolean(value)
324905
def getBool(t):
    
    b = c_int()
    if PL_get_long(t, byref(b)):
        return bool(b.value)
    else:
        raise InvalidTypeError("bool")
1292070
private static function parseIniBoolean($booleanStr) {
		if (empty($booleanStr)) {
			return false;
		}

		$booleanStr = \strtolower($booleanStr);

		if ($booleanStr === 'off' || $booleanStr === 'false' || $booleanStr === 'no' || $booleanStr === 'none') {
			return false;
		}

		if (((bool) $booleanStr) === false) {
			return false;
		}

		return true;
	}
762470
def get_cgi_parameter_str_or_none(form: cgi.FieldStorage,
                                  key: str) -> Optional[str]:
    
    s = get_cgi_parameter_str(form, key)
    if s is None or len(s) == 0:
        return None
    return s
842150
def getbool(self, key, **kwargs):
        

        def _string_to_bool(s):
            if isinstance(s, str):
                if s.strip().lower() in ('true', 't', '1'): return True
                elif s.strip().lower() in ('false', 'f', '0', 'None', 'null', ''): return False

                raise ValueError('Unable to get boolean value of "{}".'.format(s))
            #end if

            return bool(s)
        #end def

        return self.get(key, cast_func=_string_to_bool, **kwargs)
689335
def parse_bool(cls, value, default=None):
        """"""
        if value is None:
            return default

        elif isinstance(value, bool):
            return value

        elif isinstance(value, str):
            if value == 'True':
                return True
            elif value == 'False':
                return False

        raise Exception("Value %s is not boolean." % value)
878571
def get_cgi_parameter_float(form: cgi.FieldStorage,
                            key: str) -> Optional[float]:
    
    return get_float_or_none(get_cgi_parameter_str(form, key))
1313272
def _checkBool(inputvalue, description='inputvalue'):
    
    _checkString(description, minlength=1, description='description string')
    if not isinstance(inputvalue, bool):
        raise TypeError('The {0} must be boolean. Given: {1!r}'.format(description, inputvalue))
1053311
def _to_bool(value):
        """"""
        bool_value = False
        if str(value).lower() in ['1', 'true']:
            bool_value = True
        return bool_value
1166729
def get_bool_attr(self, name):
    
    val = self.get_attr(name)
    return val is not None and val.lower() in ("true", name)