boolean_literal : TRUE
                           | FALSE
549735
def p_boolean_literal(self, p):
        
        p[0] = self.asttypes.Boolean(p[1])
        p[0].setpos(p)
933464
def boolValue(self):
        
        if self.lastValue == 1 or self.lastValue == "active":
            self._key = 1
            self._boolKey = True
        else:
            self._key = 0
            self._boolKey = False
        return self._boolKey
286725
def _or(ctx, *logical):
    
    for arg in logical:
        if conversions.to_boolean(arg, ctx):
            return True
    return False
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
1235615
def _parse_bool(self, value):
        """"""
        if isinstance(value, string_types):
            return value.strip().lower() in ['true', '1', 't', 'y', 'yes']
        return bool(value)
1037476
def extract_literal_bool(templatevar):
    
    # FilterExpression contains another 'var' that either contains a Variable or SafeData object.
    if hasattr(templatevar, 'var'):
        templatevar = templatevar.var
        if isinstance(templatevar, SafeData):
            # Literal in FilterExpression, can return.
            return is_true(templatevar)
        else:
            # Variable in FilterExpression, not going to work here.
            return None

    return is_true(templatevar)
1180123
def boolean(text):
    

    tmp = text.lower()
    if tmp.isdigit():
        return bool(int(tmp))
    elif tmp in ('t', 'true', 'on', 'yes'):
        return True
    elif tmp in ('f', 'false', 'off', 'no'):
        return False

    raise ValueError("invalid Boolean value %r" % text)
500068
def isbool(*args):
    """"""
    true_or_false = [instructions.lookup(instructions.true_),
                     instructions.lookup(instructions.false_)]
    return all(map(lambda c: isinstance(c, bool) or c in true_or_false, args))
1327237
def parse_bool(value):
    
    value = str(value).lower()
    if value in ('on', 'true', 'yes', '1'):
        return True
    if value in ('off', 'false', 'no', '0'):
        return False
213395
def parse(self, val):
        
        s = str(val).lower()
        if s == "true":
            return True
        elif s == "false":
            return False
        else:
            raise ValueError("cannot interpret '{}' as boolean".format(val))
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
803672
def _env_to_bool(val):
    
    if isinstance(val, bool):
        return val
    val = val.strip().lower()
    if val in ("1", "true", "yes"):
        return True

    return False
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
1207078
def bool_input(message):
    '''
    
    '''

    while True:
        suffix = ' (true or false): '
        inp = input(message + suffix)
        if inp.lower() == 'true':
            return True
        elif inp.lower() == 'false':
            return False
        else:
            print(colored('Must be either true or false, try again!', 'red'))
1123168
def p_term_bool(self, p):
        '''  
        '''
        _LOGGER.debug("term -> TRUE/FALSE")

        if p[1].lower() == 'true':
            p[0] = TypedClass(True, TypedClass.BOOLEAN)
        else:
            p[0] = TypedClass(False, TypedClass.BOOLEAN)
624556
public static Boolean coerceToBoolean(Object pValue,
                                          Logger pLogger)
            throws ELException {
        if (pValue == null ||
                "".equals(pValue)) {
            return Boolean.FALSE;
        } else if (pValue instanceof Boolean) {
            return (Boolean) pValue;
        } else if (pValue instanceof String) {
            String str = (String) pValue;
            try {
                return Boolean.valueOf(str);
            }
            catch (Exception exc) {
                if (pLogger.isLoggingError()) {
                    pLogger.logError
                            (Constants.STRING_TO_BOOLEAN,
                                    exc,
                                    (String) pValue);
                }
                return Boolean.FALSE;
            }
        } else {
            if (pLogger.isLoggingError()) {
                pLogger.logError
                        (Constants.COERCE_TO_BOOLEAN,
                                pValue.getClass().getName());
            }
            return Boolean.TRUE;
        }
    }
195957
def set_boolean(self, option, value):
        
        if not isinstance(value, bool):
            raise TypeError("%s must be a boolean" % option)

        self.options[option] = str(value).lower()