def ifnot(if_, else_, transform=None):
    """Returns the condition ``if_`` iff it evaluates to ``True``, or if a transformation is
    specified, ``transform(if_)``. Returns ``else_`` if the condition is ``False``.
    ``transform`` can be any callable, which will be passed ``if_`` in case ``if_`` is not ``False``."""
    if not bool(if_):
        return else_
    elif transform is not None:
        return transform(if_)
    else:
        return if_
