def get_swagger_title(obj):
    """
    Gets a title for the given object. This title will be used
    as a name/key for the object in swagger.

    :param obj:
    :rtype: str
    """
    if hasattr(obj, "__swagger_title__"):
        return obj.__swagger_title__
    elif hasattr(obj, "__name__"):
        return obj.__name__
    else:
        return obj.__class__.__name__