def _wrapped_include(arg):
    """Convert the old 3-tuple arg for include() into the new format.

    The argument "arg" should be a tuple with 3 elements:
    (pattern_list, app_namespace, instance_namespace)

    Prior to Django 2.0, django.urls.conf.include() accepts 3-tuple arg
    (urlconf, namespace, app_name), but it was droppped in Django 2.0.
    This function is used to convert the older 3-tuple used in horizon code
    into the new format where namespace needs to be passed as the second arg.

    For more details, see
    https://docs.djangoproject.com/en/2.0/releases/1.9/#passing-a-3-tuple-or-an-app-name-to-include
    """
    pattern_list, app_namespace, instance_namespace = arg
    return include((pattern_list, app_namespace), namespace=instance_namespace)