def descendant(class_or_instance, class_):
    """
    This function takes a class or instance and determines if it is either a
    subclass or instance of *class_*. This is useful if you allow either a class
    or an instance to serve as a template for a function.
    
    :param class_or_instance: The class or instance to check against *class_*
    
    :param class\\_: The class being checked for an inheritance relationship.
    
    :returns: Boolean True if *class_or_instance* is in some way a descendant
        of *class_*, False otherwise.
    """
    if type(class_or_instance) == type:
        return issubclass(class_or_instance, class_)
    else:
        return isinstance(class_or_instance, class_)
