Fetches a boolean parameter via :func:`get_string_relative`.
764974
def get_bool_relative(strings: Sequence[str],
                      prefix1: str,
                      delta: int,
                      prefix2: str,
                      ignoreleadingcolon: bool = False) -> Optional[bool]:
    
    return get_bool_raw(get_string_relative(
        strings, prefix1, delta, prefix2,
        ignoreleadingcolon=ignoreleadingcolon))
439586
def get_bool_value(self, section, option, default=True):
        """"""
        try:
            return self.parser.getboolean(section, option)
        except NoOptionError:
            return bool(default)
276420
def arg_bool(name, default=False):
    
    v = request.args.get(name, '')
    if not len(v):
        return default
    return v in BOOL_TRUISH
615253
def str_to_bool(val):
    
    if isinstance(val, str):
        val = val.lower()

    return val in ["true", "on", "yes", True]
1374424
def _isbool(string):
    
    return isinstance(string, _bool_type) or\
        (isinstance(string, (_binary_type, _text_type))
         and
         string in ("True", "False"))
607450
private Boolean getBooleanParameter(String key){
        Integer i = (Integer)parameters.get(key);
        if (i == null){
            return null;
        }
        return i.equals(1);
    }
646601
def get_cgi_parameter_bool_or_none(form: cgi.FieldStorage,
                                   key: str) -> Optional[bool]:
    
    return get_cgi_parameter_bool_or_default(form, key, default=None)
534504
def lowcase_str_boolean(obj):
    ""
    if isinstance(obj, str):
        if obj not in ["true", "false"]:
            raise RuntimeError(
                'Expecting "true" or "false", got {}'.format(obj))
        return obj
    return str(bool(obj)).lower()
261696
def string_or_bool(value):
    
    if value.lower() in ['t', 'true']:
        value = True
    elif value.lower() in ['f', 'false']:
        value = False
    elif str.isdigit(str(value)):
        value = int(value) != 0
    else:
        value = str(value) # pylint: disable=redefined-variable-type
    return value
133915
public boolean getBool(String name, boolean def) {
        final String s = getProperty(name);
        if (s == null) {
            return def;
        }
        try {
            return s != null && s.equalsIgnoreCase("true");
        } catch (Exception e) {
            return def;
        }
    }
466727
def booleanize(truthy):
    '''
    
    '''
    if truthy is None:
        return False
    elif isinstance(truthy, basestring):
        if truthy:
            try:
                return bool(distutils.util.strtobool(truthy))
            except ValueError:
                return True
        else:
            return False
    elif is_collection(truthy):
        return not is_empty(truthy)
    else:
        return bool(truthy)
868205
def bool_str(string):
    """'"""
    if string not in BOOL_STRS:
        raise ValueError('Invalid boolean string: "{}"'.format(string))
    return True if string == 'true' else False
1166729
def get_bool_attr(self, name):
    
    val = self.get_attr(name)
    return val is not None and val.lower() in ("true", name)
1364197
def get_boolean(self, input_string):
        

        if input_string in ('--write_roc', '--plot', '--compare'):

            # was the flag set?
            try:
                index = self.args.index(input_string) + 1
            except ValueError:
                # it wasn't, args are optional, so return the appropriate default
                return False

            # the flag was set, so return the True
            return True
141575
def FromString(self, string):
    """"""
    if string.lower() in ("false", "no", "n"):
      return False

    if string.lower() in ("true", "yes", "y"):
      return True

    raise TypeValueError("%s is not recognized as a boolean value." % string)
1356647
public boolean getBoolean(String key, boolean def) {
        String value = getString(key);
        if (value == null) {
            return def;
        }
        else {
            return "true".equalsIgnoreCase(value);
        }
    }
8008
public boolean getBoolean(String key, boolean def) {
        Object tmp = objectMap.get(key);
        return tmp != null && tmp instanceof Boolean ? (Boolean) tmp : def;
    }