def METHOD_NAME(base):
    """
    Construct an attrs validator that raises :py:`TypeError` is not a subclass
    of the given base class.
    :param type base: The given base class
    :return Callable[[Any, attr.Attribute, Any], None]: An attrs validator.
    """
    def validator(inst, attr, value):
        if not issubclass(value, base):
            raise TypeError(
                "'{name}' must be a subclass of {base!r}"
                "(got {value!r}).".format(
                    name=attr.name,
                    base=base,
                    value=value,
                )
            )
    return validator