Understand bool calls.
14047
def infer_bool(node, context=None):
    """"""
    if len(node.args) > 1:
        # Invalid bool call.
        raise UseInferenceDefault

    if not node.args:
        return nodes.Const(False)

    argument = node.args[0]
    try:
        inferred = next(argument.infer(context=context))
    except InferenceError:
        return util.Uninferable
    if inferred is util.Uninferable:
        return util.Uninferable

    bool_value = inferred.bool_value()
    if bool_value is util.Uninferable:
        return util.Uninferable
    return nodes.Const(bool_value)
959207
def get_bool_data(self, copy=False):
        
        self._consolidate_inplace()
        return self.combine([b for b in self.blocks if b.is_bool], copy)
318838
def get_bool(_bytearray, byte_index, bool_index):
    
    index_value = 1 << bool_index
    byte_value = _bytearray[byte_index]
    current_value = byte_value & index_value
    return current_value == index_value
644145
def on_boolop(self, node):    # ('op', 'values')
        """"""
        val = self.run(node.values[0])
        is_and = ast.And == node.op.__class__
        if (is_and and val) or (not is_and and not val):
            for n in node.values[1:]:
                val = op2func(node.op)(val, self.run(n))
                if (is_and and not val) or (not is_and and val):
                    break
        return val
941923
function boolOrFn(val, args) {
    if (typeof val == TYPE_FUNCTION) {
        return val.apply(args ? args[0] || undefined : undefined, args);
    }
    return val;
}
359090
def visit_Boolean(self, node):
        """"""
        if node.value == 'true':
            return Bool(True)
        elif node.value == 'false':
            return Bool(False)
354273
@Override
    public boolean asBoolean() {
        final Class<?> callerClass = ReflectionHelper.getDirectCallerClass();
        return evaluateSingeValue(Boolean.TYPE, callerClass);
    }
505866
def boolean(v):
    """"""
    if nodesetp(v):
        return len(v) > 0
    elif numberp(v):
        if v == 0 or v != v:
            return False
        return True
    elif stringp(v):
        return v != ''
    return v
615253
def str_to_bool(val):
    
    if isinstance(val, str):
        val = val.lower()

    return val in ["true", "on", "yes", True]
871825
def frombools(cls, bools):
        """"""
        return cls.frombitsets(map(cls.BitSet.frombools, bools))
1365257
def to_bool(x):
    """""""
    if isinstance(x, bool):
        return x
    elif isinstance(x, str):
        return False if x.lower() in _FALSES else True
    else:
        return bool(x)
682369
function isBool(value, message, id) {
    if (message === void 0) { message = ''; }
    if (id === void 0) { id = ''; }
    if (this.enabled && typeof value !== 'boolean') {
        throw TypeException.unexpectedType(assertionTypes.IS_BOOL, value, '<boolean>', message, id);
    }
}
360031
def _get_boolean(self, source, bitarray):
        '''  '''
        raw_value = self._get_raw(source, bitarray)
        return {
            source['shortcut']: {
                'description': source.get('description'),
                'unit': source.get('unit', ''),
                'value': True if raw_value else False,
                'raw_value': raw_value,
            }
        }
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)
571509
function bool(val) {
	assert(typeof val === 'boolean')
	var a = []
	a.op = 'bool'
	a.val = val
	return a
}
204222
def frombools(cls, bools=()):
        """"""
        return cls.fromint(sum(compress(cls._atoms, bools)))
1095132
def parse_bool(v, default=None, exceptions: bool=True) -> bool:
    
    if isinstance(v, bool):
        return v
    s = str(v).lower()
    if s in TRUE_VALUES:
        return True
    elif s in FALSE_VALUES:
        return False
    else:
        if exceptions:
            raise ValidationError('Failed to parse boolean from "{}"'.format(v))
        return default