Represent bool as 'yes' or 'no' instead of 'true' or 'false'.
966916
def represent_bool(self, data):
        
        if data:
            value = u'yes'
        else:
            value = u'no'
        return self.represent_scalar('tag:yaml.org,2002:bool', value)
122914
def process_bool_arg(arg):
    
    if isinstance(arg, bool):
        return arg
    elif isinstance(arg, basestring):
        if arg.lower() in ["true", "1"]:
            return True
        elif arg.lower() in ["false", "0"]:
            return False
1374424
def _isbool(string):
    
    return isinstance(string, _bool_type) or\
        (isinstance(string, (_binary_type, _text_type))
         and
         string in ("True", "False"))
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)
544246
def _ConvertBool(value, require_str):
  
  if require_str:
    if value == 'true':
      return True
    elif value == 'false':
      return False
    else:
      raise ParseError('Expected "true" or "false", not {0}.'.format(value))

  if not isinstance(value, bool):
    raise ParseError('Expected true or false without quotes.')
  return value
810701
def to_bool(value):
    
    cases = {
        '0': False,
        'false': False,
        'no': False,

        '1': True,
        'true': True,
        'yes': True,
    }
    value = value.lower() if isinstance(value, basestring) else value
    return cases.get(value, bool(value))
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)
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)
1361197
def convertBooleanStringToBoolean(val=None):
    '''
        
    '''
    if not val:
        return False

    if hasattr(val, 'lower'):
        val = val.lower()

    if val == "false":
        return False
    return True
1038988
def _str_to_bool(str_):
    """"""
    if str_.lower() not in ['true', 'false', 'none']:
        raise ValueError('Need bool; got %r' % str_)
    return {'true': True, 'false': False, 'none': None}[str_.lower()]
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
275366
def _send_bool(self,value):
        

        # Sanity check.
        if type(value) != bool and value not in [0,1]:
            err = "{} is not boolean.".format(value)
            raise ValueError(err)

        return struct.pack("?",value)
359090
def visit_Boolean(self, node):
        """"""
        if node.value == 'true':
            return Bool(True)
        elif node.value == 'false':
            return Bool(False)
1323121
def convert_boolean(value, parameter, default=False):
    '''
    
    '''
    value = _check_default(value, parameter, ( '', '-', None ))
    if isinstance(value, bool):
        return value
    if isinstance(value, str) and len(value) > 0:
        value = value[0]
    return value not in ( 'f', 'F', '0', False, None )
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
1142066
def _encode_bool(name, value, dummy0, dummy1):
    """"""
    return b"\x08" + name + (value and b"\x01" or b"\x00")
954494
static function toBoolean ($v)
  {
    return is_string ($v) ? get (self::$BOOLEAN_VALUES, $v, false) : boolval ($v);
  }