<commit_before>from django.conf.urls import url, patterns

from readthedocs.urls import urlpatterns as main_patterns

handler500 = 'readthedocs.core.views.server_error'
handler404 = 'readthedocs.core.views.server_error_404'

urlpatterns = patterns(
    '',  # base view, flake8 complains if it is on the previous line.
    url(r'^page/(?P<filename>.*)$',
        'readthedocs.core.views.serve.redirect_page_with_filename',
        name='docs_detail'),

    url(r'^$', 'readthedocs.core.views.serve.redirect_project_slug', name='redirect_project_slug'),
    url(r'', 'readthedocs.core.views.serve.serve_symlink_docs', name='serve_symlink_docs'),
)

urlpatterns += main_patterns<commit_msg>Serve media in subdomains during DEBUG<commit_after>from operator import add

from django.conf.urls import url, patterns
from django.conf import settings
from django.conf.urls.static import static

from readthedocs.urls import urlpatterns as main_patterns

handler500 = 'readthedocs.core.views.server_error'
handler404 = 'readthedocs.core.views.server_error_404'

subdomain_urls = patterns(
    '',  # base view, flake8 complains if it is on the previous line.
    url(r'^page/(?P<filename>.*)$',
        'readthedocs.core.views.serve.redirect_page_with_filename',
        name='docs_detail'),

    url(r'^$', 'readthedocs.core.views.serve.redirect_project_slug', name='redirect_project_slug'),
    url(r'', 'readthedocs.core.views.serve.serve_symlink_docs', name='serve_symlink_docs'),
)

groups = [subdomain_urls]

if getattr(settings, 'DEBUG', False):
    groups.insert(0, static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT))

groups.append(main_patterns)

urlpatterns = reduce(add, groups)
{'fraction_non_alphanumeric': 0.12359550561797752, 'fraction_numerical': 0.012418687167356593, 'mean_word_length': 5.507692307692308, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '5197215', 'n_tokens_mistral': 590, 'n_tokens_neox': 569, 'n_words': 105}