def boolean(var, var_name):
    """
    Check if *var* is a boolean.

    :raises TypeError: Parameter *var* must be a bool.
    """
    if not isinstance(var, bool):
        raise TypeError('\n\nParameter {} must be a bool.\n'.format(var_name))
