def is_callable(attribute, instance=None):
    """Check if value or attribute of instance are callable."""
    try:
        if instance:
            return callable(getattr(instance, attribute))
        else:
            return callable(attribute)
    except AttributeError:
        return False