def supports_tagging(obj):
    """
    :param obj: a class or instance
    """
    if isinstance(obj, type):
        return issubclass(obj, SupportTagging)

    if not isinstance(obj, SupportTagging):
        return False

    if obj.id is None:
        return False

    return True
def supports_tagging ( obj ) : if isinstance ( obj , type ) : return issubclass ( obj , SupportTagging ) if not isinstance ( obj , SupportTagging ) : return False if obj . id is None : return False return True
:param obj: a class or instance