(string)
Converts either 'true' or 'false' (not case-sensitively) into a boolean.
Converts either 'true' or 'false' (not case-sensitively) into a boolean.
Converts either true or false ( not case - sensitively ) into a boolean .
def _str2bool(string):
  """Converts either 'true' or 'false' (not case-sensitively) into a boolean."""
  if string is None:
    return False
  else:
    string = string.lower()

  if string == 'true':
    return True
  elif string == 'false':
    return False
  else:
    raise ValueError(
        'String should either be `true` or `false`: got {}'.format(string))
def _str2bool ( string ) : if string is None : return False else : string = string . lower ( ) if string == 'true' : return True elif string == 'false' : return False else : raise ValueError ( 'String should either be `true` or `false`: got {}' . format ( string ) )