<commit_before># -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
import os
from functools import reduce
from operator import add

from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic.base import RedirectView, TemplateView

from readthedocs.core.urls import core_urls, deprecated_urls, docs_urls
from readthedocs.core.views import (
    HomepageView,
    SupportView,
    do_not_track,
    server_error_404,
    server_error_500,
)
from readthedocs.search import views as search_views
from readthedocs.search.api import PageSearchAPIView


admin.autodiscover()

handler404 = server_error_404
handler500 = server_error_500

basic_urls = [
    url(r'^$', HomepageView.as_view(), name='homepage'),
    url(r'^support/', SupportView.as_view(), name='support'),
    url(r'^security/', TemplateView.as_view(template_name='security.html')),
    url(
        r'^\.well-known/security.txt$',
        TemplateView
        .as_view(template_name='security.txt', content_type='text/plain'),
    ),
]

rtd_urls = [
    url(r'^search/$', search_views.elastic_search, name='search'),
    url(r'^dashboard/', include('readthedocs.projects.urls.private')),
    url(r'^profiles/', include('readthedocs.profiles.urls.public')),
    url(r'^accounts/', include('readthedocs.profiles.urls.private')),
    url(r'^accounts/', include('allauth.urls')),
    url(r'^notifications/', include('readthedocs.notifications.urls')),
    url(r'^accounts/gold/', include('readthedocs.gold.urls')),
    # For redirects
    url(r'^builds/', include('readthedocs.builds.urls')),
    # For testing the 404's with DEBUG on.
    url(r'^404/$', handler404),
    # For testing the 500's with DEBUG on.
    url(r'^500/$', handler500),
]

project_urls = [
    url(r'^projects/', include('readthedocs.projects.urls.public')),
]

api_urls = [
    url(r'^api/v2/', include('readthedocs.restapi.urls')),
    # Keep the `doc_search` at root level, so the test does not fail for other API
    url(r'^api/v2/docsearch/$', PageSearchAPIView.as_view(), name='doc_search'),
    url(
        r'^api-auth/',
        include('rest_framework.urls', namespace='rest_framework')
    ),
    url(r'^api/v3/', include('readthedocs.v3.urls')),
]

i18n_urls = [
    url(r'^i18n/', include('django.conf.urls.i18n')),
]

admin_urls = [
    url(r'^admin/', admin.site.urls),
]

dnt_urls = [
    url(r'^\.well-known/dnt/$', do_not_track),

    # https://github.com/EFForg/dnt-guide#12-how-to-assert-dnt-compliance
    url(
        r'^\.well-known/dnt-policy.txt$',
        TemplateView
        .as_view(template_name='dnt-policy.txt', content_type='text/plain'),
    ),
]

debug_urls = []
for build_format in ('epub', 'htmlzip', 'json', 'pdf'):
    debug_urls += static(
        settings.MEDIA_URL + build_format,
        document_root=os.path.join(settings.MEDIA_ROOT, build_format),
    )<commit_msg>Follow the pattern for URLs<commit_after># -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
import os
from functools import reduce
from operator import add

from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic.base import RedirectView, TemplateView

from readthedocs.core.urls import core_urls, deprecated_urls, docs_urls
from readthedocs.core.views import (
    HomepageView,
    SupportView,
    do_not_track,
    server_error_404,
    server_error_500,
)
from readthedocs.search import views as search_views
from readthedocs.search.api import PageSearchAPIView


admin.autodiscover()

handler404 = server_error_404
handler500 = server_error_500

basic_urls = [
    url(r'^$', HomepageView.as_view(), name='homepage'),
    url(r'^support/', SupportView.as_view(), name='support'),
    url(r'^security/', TemplateView.as_view(template_name='security.html')),
    url(
        r'^\.well-known/security.txt$',
        TemplateView
        .as_view(template_name='security.txt', content_type='text/plain'),
    ),
]

rtd_urls = [
    url(r'^search/$', search_views.elastic_search, name='search'),
    url(r'^dashboard/', include('readthedocs.projects.urls.private')),
    url(r'^profiles/', include('readthedocs.profiles.urls.public')),
    url(r'^accounts/', include('readthedocs.profiles.urls.private')),
    url(r'^accounts/', include('allauth.urls')),
    url(r'^notifications/', include('readthedocs.notifications.urls')),
    url(r'^accounts/gold/', include('readthedocs.gold.urls')),
    # For redirects
    url(r'^builds/', include('readthedocs.builds.urls')),
    # For testing the 404's with DEBUG on.
    url(r'^404/$', handler404),
    # For testing the 500's with DEBUG on.
    url(r'^500/$', handler500),
]

project_urls = [
    url(r'^projects/', include('readthedocs.projects.urls.public')),
]

api_urls = [
    url(r'^api/v2/', include('readthedocs.restapi.urls')),
    # Keep the `doc_search` at root level, so the test does not fail for other API
    url(r'^api/v2/docsearch/$', PageSearchAPIView.as_view(), name='doc_search'),
    url(
        r'^api/auth/',
        include('rest_framework.urls', namespace='rest_framework')
    ),
    url(r'^api/v3/', include('readthedocs.v3.urls')),
]

i18n_urls = [
    url(r'^i18n/', include('django.conf.urls.i18n')),
]

admin_urls = [
    url(r'^admin/', admin.site.urls),
]

dnt_urls = [
    url(r'^\.well-known/dnt/$', do_not_track),

    # https://github.com/EFForg/dnt-guide#12-how-to-assert-dnt-compliance
    url(
        r'^\.well-known/dnt-policy.txt$',
        TemplateView
        .as_view(template_name='dnt-policy.txt', content_type='text/plain'),
    ),
]

debug_urls = []
for build_format in ('epub', 'htmlzip', 'json', 'pdf'):
    debug_urls += static(
        settings.MEDIA_URL + build_format,
        document_root=os.path.join(settings.MEDIA_ROOT, build_format),
    )
{'fraction_non_alphanumeric': 0.16083445491251683, 'fraction_numerical': 0.01648721399730821, 'mean_word_length': 4.042408821034775, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3175581', 'n_tokens_mistral': 2192, 'n_tokens_neox': 2101, 'n_words': 358}