def ensure_indirect_subclass(class_, of):
    """Check whether given is an indirect subclass of another,
    i.e. there exists at least intermediate base between ``of`` and ``class_``.

    :param class_: Class to check
    :param of: Superclass to check against

    :return: ``class_``, if the check succeeds
    :raise TypeError: When the check fails

    .. versionadded:: 0.0.4
    """
    if not is_indirect_subclass(class_, of):
        raise TypeError(
            "expected an indirect subclass of %r, got %s instead" % (
                of, class_.__name__))
    return class_