def as_bool(self, key):
val = self[key]<EOL>if isinstance(val, bool):<EOL><INDENT>return val<EOL><DEDENT>return val.lower() == "<STR_LIT:yes>"<EOL>
Express given key's value as a boolean type.

Typically, this is used for ``ssh_config``'s pseudo-boolean values
which are either ``"yes"`` or ``"no"``. In such cases, ``"yes"`` yields
``True`` and any other value becomes ``False``.

.. note::
    If (for whatever reason) the stored value is already boolean in
    nature, it's simply returned.

.. versionadded:: 2.5