str, bool, bool -> str
771527
def make_sh_address(script_string, witness=False, cashaddr=True):
    '''
    
    '''
    script_bytes = script_ser.serialize(script_string)

    return _ser_script_to_sh_address(
        script_bytes=script_bytes,
        witness=witness,
        cashaddr=cashaddr)
656295
def bool(self, name):
        """"""
        self._assert_is_string(name)
        frame = self._next_frame()
        if len(frame) != 1:
            raise MessageParserError("Expected exacty 1 byte for boolean value")
        val = frame != b"\x00"
        self.results.__dict__[name] = val
        return self
1235615
def _parse_bool(self, value):
        """"""
        if isinstance(value, string_types):
            return value.strip().lower() in ['true', '1', 't', 'y', 'yes']
        return bool(value)
110294
public boolean toBoolean(String str, boolean defaultValue) {

		if (StringUtils.equalsIgnoreCase(null, str)) {
			return defaultValue;
		} else if (StringUtils.equalsIgnoreCase("true", str)) {
			return true;
		} else if (StringUtils.equalsIgnoreCase("false", str)) {
			return false;
		} else if (StringUtils.equalsIgnoreCase("1", str)) {
			return true;
		} else if (StringUtils.equalsIgnoreCase("0", str)) {
			return false;
		} else {
			return defaultValue;
		}

	}
550051
def setting_str_to_bool(s):
    
    if isinstance(s, six.string_types):
        s = s.lower()
        if s == 'true':
            return True
        elif s == 'false':
            return False
        else:
            return ValueError('Invalid boolean representation: {!r}'.format(s))
    else:
        return s
694370
def try_parse_num_and_booleans(num_str):
    
    if isinstance(num_str, str):
        # bool
        if num_str.lower() == 'true':
            return True
        elif num_str.lower() == 'false':
            return False
        # int
        if num_str.isdigit():
            return int(num_str)
        # float
        try:
            return float(num_str)
        except ValueError:
            # give up
            return num_str
    else:
        # dont try
        return num_str
383732
def parse_value(self, text: str) -> Optional[bool]:
        
        if text == "true":
            return True
        if text == "false":
            return False
549735
def p_boolean_literal(self, p):
        
        p[0] = self.asttypes.Boolean(p[1])
        p[0].setpos(p)
538975
def str_to_boolean(input_str):
    
    if not isinstance(input_str, six.string_types):
        raise ValueError(input_str)
    input_str = str_quote_stripper(input_str)
    return input_str.lower() in ("true", "t", "1", "y", "yes")
954409
def str_to_bool(val):
    

    if isinstance(val, bool):
        return val
    elif val.lower() == 'true':
        return True
    elif val.lower() == 'false':
        return False
    else:
        raise ValueError
602805
def input(self, str):
        
        self.input_data = str
        self.lex = lex.lex(object=self)
        self.lex.input(self.input_data)
941923
function boolOrFn(val, args) {
    if (typeof val == TYPE_FUNCTION) {
        return val.apply(args ? args[0] || undefined : undefined, args);
    }
    return val;
}
1371248
def istrue(self, *args):
        
        def is_true(val):
            if val is True:
                return True
            val = str(val).lower().strip()
            return val in ('true', 'yes', '1')
        return all(self._arg_factory(is_true, args))
1353105
def eval_bool(self, expr):
        
        result = expr.eval(self)
        iterator = iter(result)
        try:
            next(iterator)
        except StopIteration:
            return False
        else:
            return True
        finally:
            if hasattr(iterator, "close"):
                iterator.close()
348197
def _bool_encode(self, d):
        
        for k, v in d.items():
            if isinstance(v, bool):
                d[k] = str(v).lower()
        
        return d
787576
def bool(self, item, default=None):
        
        try:
            item = self.__getattr__(item)
        except AttributeError as err:
            if default is not None:
                return default
            raise err

        if isinstance(item, (bool, int)):
            return bool(item)

        if (isinstance(item, str) and
                item.lower() in ('n', 'no', 'false', 'f', '0')):
            return False

        return True if item else False
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)