<commit_before># coding: utf-8
import private_storage.urls
from django.conf import settings
from django.urls import include, re_path, path
from django.views.i18n import JavaScriptCatalog

from hub.models import ConfigurationFile
from hub.views import ExtraDetailRegistrationView
from kobo.apps.superuser_stats.views import (
    continued_usage_report,
    country_report,
    domain_report,
    forms_count_by_submission_report,
    media_storage,
    reports_list,
    retrieve_reports,
    user_count_by_organization,
    user_report,
    user_statistics_report,
)
from kpi.forms.registration import RegistrationForm
from kpi.views import authorized_application_authenticate_user
from kpi.views import home, one_time_login, browser_tests, design_system, modern_browsers
from kpi.views.environment import EnvironmentView
from kpi.views.current_user import CurrentUserViewSet
from kobo.apps.mfa.views import (
    MFALoginView,
    MFATokenView,
)
from kpi.views.token import TokenView

from .router_api_v1 import router_api_v1
from .router_api_v2 import router_api_v2, URL_NAMESPACE

# TODO: Give other apps their own `urls.py` files instead of importing their
# views directly! See
# https://docs.djangoproject.com/en/1.8/intro/tutorial03/#namespacing-url-names


# Apps whose translations should be available in the client code.
urlpatterns = [
    path('', home, name='kpi-root'),
    path('me/', CurrentUserViewSet.as_view({
        'get': 'retrieve',
        'patch': 'partial_update',
    }), name='currentuser-detail'),
    re_path(r'^', include(router_api_v1.urls)),
    re_path(r'^api/v2/', include((router_api_v2.urls, URL_NAMESPACE))),
    re_path(r'^api/v2/auth/', include('kobo.apps.mfa.urls')),
    re_path(r'^accounts/register/$', ExtraDetailRegistrationView.as_view(
        form_class=RegistrationForm), name='registration_register'),
    re_path(r'^accounts/login/mfa/', MFATokenView.as_view(), name='mfa_token'),
    re_path(r'^accounts/login/', MFALoginView.as_view(), name='kobo_login'),
    re_path(r'^accounts/', include('registration.backends.default.urls')),
    re_path(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')),
    re_path(
        r'^authorized_application/authenticate_user/$',
        authorized_application_authenticate_user
    ),
    path('browser_tests/', browser_tests),
    path('modern_browsers/', modern_browsers),
    path('design-system/', design_system),
    path('authorized_application/one_time_login/', one_time_login),
    re_path(r'^i18n/', include('django.conf.urls.i18n')),
    # Translation catalog for client code.
    path('jsi18n/', JavaScriptCatalog.as_view(),
         name='javascript-catalog'),
    path('token/', TokenView.as_view(), name='token'),
    path('environment/', EnvironmentView.as_view(), name='environment'),
    re_path(r'^configurationfile/(?P<slug>[^/]+)/?',
            ConfigurationFile.redirect_view, name='configurationfile'),
    re_path(r'^private-media/', include(private_storage.urls)),
    # Statistics for superusers
    path('superuser_stats/', reports_list),
    path('superuser_stats/user_report/', user_report),
    re_path(r'^superuser_stats/user_report/(?P<base_filename>[^/]+)$',
            retrieve_reports),
    path('superuser_stats/continued_usage_report/', continued_usage_report),
    re_path(r'^superuser_stats/continued_usage_report/(?P<base_filename>[^/]+)$',
            retrieve_reports),
    path('superuser_stats/domain_report/', domain_report),
    re_path(r'^superuser_stats/domain_report/(?P<base_filename>[^/]+)$', retrieve_reports),
    path('superuser_stats/media_storage_report/', media_storage),
    re_path(r'^superuser_stats/media_storage_report/(?P<base_filename>[^/]+)$', retrieve_reports),
    path('superuser_stats/country_report/', country_report),
    re_path(r'^superuser_stats/country_report/(?P<base_filename>[^/]+)$', retrieve_reports),
    path('superuser_stats/user_count_by_org/', user_count_by_organization),
    re_path(r'^superuser_stats/user_count_by_org/(?P<base_filename>[^/]+)$', retrieve_reports),
    path('superuser_stats/user_statistics_report/', user_statistics_report),
    re_path(r'^superuser_stats/user_statistics_report/(?P<base_filename>[^/]+)$',
            retrieve_reports),
    path('superuser_stats/forms-by-submissions-count/', forms_count_by_submission_report),
    re_path(r'^superuser_stats/forms-by-submissions-count/(?P<base_filename>[^/]+)$',
            retrieve_reports),
]

if settings.DEBUG and settings.ENV == 'dev':
    import debug_toolbar
    urlpatterns = [
        path('__debug__/', include(debug_toolbar.urls)),
    ] + urlpatterns<commit_msg>reordered superuser paths<commit_after># coding: utf-8
import private_storage.urls
from django.conf import settings
from django.urls import include, re_path, path
from django.views.i18n import JavaScriptCatalog

from hub.models import ConfigurationFile
from hub.views import ExtraDetailRegistrationView
from kobo.apps.superuser_stats.views import (
    continued_usage_report,
    country_report,
    domain_report,
    forms_count_by_submission_report,
    media_storage,
    reports_list,
    retrieve_reports,
    user_count_by_organization,
    user_report,
    user_statistics_report,
)
from kpi.forms.registration import RegistrationForm
from kpi.views import authorized_application_authenticate_user
from kpi.views import home, one_time_login, browser_tests, design_system, modern_browsers
from kpi.views.environment import EnvironmentView
from kpi.views.current_user import CurrentUserViewSet
from kobo.apps.mfa.views import (
    MFALoginView,
    MFATokenView,
)
from kpi.views.token import TokenView

from .router_api_v1 import router_api_v1
from .router_api_v2 import router_api_v2, URL_NAMESPACE

# TODO: Give other apps their own `urls.py` files instead of importing their
# views directly! See
# https://docs.djangoproject.com/en/1.8/intro/tutorial03/#namespacing-url-names


# Apps whose translations should be available in the client code.
urlpatterns = [
    path('', home, name='kpi-root'),
    path('me/', CurrentUserViewSet.as_view({
        'get': 'retrieve',
        'patch': 'partial_update',
    }), name='currentuser-detail'),
    re_path(r'^', include(router_api_v1.urls)),
    re_path(r'^api/v2/', include((router_api_v2.urls, URL_NAMESPACE))),
    re_path(r'^api/v2/auth/', include('kobo.apps.mfa.urls')),
    re_path(r'^accounts/register/$', ExtraDetailRegistrationView.as_view(
        form_class=RegistrationForm), name='registration_register'),
    re_path(r'^accounts/login/mfa/', MFATokenView.as_view(), name='mfa_token'),
    re_path(r'^accounts/login/', MFALoginView.as_view(), name='kobo_login'),
    re_path(r'^accounts/', include('registration.backends.default.urls')),
    re_path(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')),
    re_path(
        r'^authorized_application/authenticate_user/$',
        authorized_application_authenticate_user
    ),
    path('browser_tests/', browser_tests),
    path('modern_browsers/', modern_browsers),
    path('design-system/', design_system),
    path('authorized_application/one_time_login/', one_time_login),
    re_path(r'^i18n/', include('django.conf.urls.i18n')),
    # Translation catalog for client code.
    path('jsi18n/', JavaScriptCatalog.as_view(),
         name='javascript-catalog'),
    path('token/', TokenView.as_view(), name='token'),
    path('environment/', EnvironmentView.as_view(), name='environment'),
    re_path(r'^configurationfile/(?P<slug>[^/]+)/?',
            ConfigurationFile.redirect_view, name='configurationfile'),
    re_path(r'^private-media/', include(private_storage.urls)),
    # Statistics for superusers
    path('superuser_stats/', reports_list),
    path('superuser_stats/continued_usage_report/', continued_usage_report),
    re_path(r'^superuser_stats/continued_usage_report/(?P<base_filename>[^/]+)$',
            retrieve_reports),
    path('superuser_stats/country_report/', country_report),
    re_path(r'^superuser_stats/country_report/(?P<base_filename>[^/]+)$',
            retrieve_reports),
    path('superuser_stats/domain_report/', domain_report),
    re_path(r'^superuser_stats/domain_report/(?P<base_filename>[^/]+)$',
            retrieve_reports),
    path('superuser_stats/forms-by-submissions-count/', forms_count_by_submission_report),
    re_path(r'^superuser_stats/forms-by-submissions-count/(?P<base_filename>[^/]+)$',
            retrieve_reports),
    path('superuser_stats/media_storage_report/', media_storage),
    re_path(r'^superuser_stats/media_storage_report/(?P<base_filename>[^/]+)$',
            retrieve_reports),
    path('superuser_stats/user_count_by_org/', user_count_by_organization),
    re_path(r'^superuser_stats/user_count_by_org/(?P<base_filename>[^/]+)$',
            retrieve_reports),
    path('superuser_stats/user_report/', user_report),
    re_path(r'^superuser_stats/user_report/(?P<base_filename>[^/]+)$',
            retrieve_reports),
    path('superuser_stats/user_statistics_report/', user_statistics_report),
    re_path(r'^superuser_stats/user_statistics_report/(?P<base_filename>[^/]+)$',
            retrieve_reports),
]

if settings.DEBUG and settings.ENV == 'dev':
    import debug_toolbar
    urlpatterns = [
        path('__debug__/', include(debug_toolbar.urls)),
    ] + urlpatterns
{'fraction_non_alphanumeric': 0.13738497753049433, 'fraction_numerical': 0.004921891718382195, 'mean_word_length': 5.113145846958797, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1835061', 'n_tokens_mistral': 3131, 'n_tokens_neox': 3026, 'n_words': 443}