<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_instance_or_subclass(val, class_):
 """Return True if ``val`` is either a subclass or instance of ``class_``."""

    try:
        return issubclass(val, class_)
    except TypeError:
        return isinstance(val, class_)