def get_token_object(auth):
    """
    Retrieve the object or instance from a
    token creation. Used for knox support.

    :param auth: The instance or tuple returned by the token's .create()
    :type auth tuple | rest_framework.authtoken.models.Token

    :return: The instance or object of the token
    :rtype: rest_framework.authtoken.models.Token | knox.models.AuthToken
    """
    return auth[0] if isinstance(auth, tuple) else auth