'Return the value of a query string parameter as a boolean
The following boolean strings are supported::
TRUE_STRINGS = (\'true\', \'True\', \'yes\', \'1\', \'on\')
FALSE_STRINGS = (\'false\', \'False\', \'no\', \'0\', \'off\')
Args:
name (str): Parameter name, case-sensitive (e.g., \'detailed\').
Keyword Args:
required (bool): Set to ``True`` to raise
``HTTPBadRequest`` instead of returning ``None`` when the
parameter is not found or is not a recognized boolean
string (default ``False``).
store (dict): A ``dict``-like object in which to place
the value of the param, but only if the param is found (default
``None``).
blank_as_true (bool): If ``True``, an empty string value will be
treated as ``True`` (default ``False``). Normally empty strings
are ignored; if you would like to recognize such parameters, you
must set the `keep_blank_qs_values` request option to ``True``.
Request options are set globally for each instance of
``falcon.API`` through the `req_options` attribute.
Returns:
bool: The value of the param if it is found and can be converted
to a ``bool``. If the param is not found, returns ``None``
unless required is ``True``.
Raises:
HTTPBadRequest: A required param is missing from the request.'

def get_param_as_bool(self, name, required=False, store=None, blank_as_true=False):

    params = self._params
    if (name in params):
        val = params[name]
        if isinstance(val, list):
            val = val[(-1)]
        if (val in TRUE_STRINGS):
            val = True
        elif (val in FALSE_STRINGS):
            val = False
        elif (blank_as_true and (not val)):
            val = True
        else:
            msg = 'The    value    of    the    parameter    must    be    "true"    or    "false".'
            raise errors.HTTPInvalidParam(msg, name)
        if (store is not None):
            store[name] = val
        return val
    if (not required):
        return None
    raise errors.HTTPMissingParam(name)
