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

urlpatterns = patterns('waliki.git.views',
    url(r'^_whatchanged$', 'whatchanged', name='waliki_whatchanged'),       # noqa
    url(r'^_hooks/pull/(?P<remote>[a-zA-Z0-9]+)$', 'webhook_pull', name='waliki_webhook_pull'),
    url(r'^(?P<slug>[a-zA-Z0-9-\/]+)/history$', 'history', name='waliki_history'),

    url(r'^(?P<slug>[a-zA-Z0-9-\/]+)/version/(?P<version>.{4,40})/raw$', 'version', {'raw': True},
        name='waliki_version_raw'),
    url(r'^(?P<slug>[a-zA-Z0-9-\/]+)/version/(?P<version>.{4,40})$', 'version', name='waliki_version'),

    url(r'^(?P<slug>[a-zA-Z0-9-\/]+)/diff/(?P<old>.{4,40})\.\.(?P<new>.{4,40})/raw$',
        'diff', {'raw': True}, name='waliki_diff_raw'),

    url(r'^(?P<slug>[a-zA-Z0-9-\/]+)/diff/(?P<old>.{4,40})\.\.(?P<new>.{4,40})$', 'diff', name='waliki_diff'),
)<commit_msg>narrow the pattern to improve security<commit_after>from django.conf.urls import patterns, url

urlpatterns = patterns('waliki.git.views',
    url(r'^_whatchanged$', 'whatchanged', name='waliki_whatchanged'),       # noqa
    url(r'^_hooks/pull/(?P<remote>[a-zA-Z0-9]+)$', 'webhook_pull', name='waliki_webhook_pull'),
    url(r'^(?P<slug>[a-zA-Z0-9-\/]+)/history$', 'history', name='waliki_history'),

    url(r'^(?P<slug>[a-zA-Z0-9-\/]+)/version/(?P<version>[0-9a-f\^]{4,40})/raw$', 'version', {'raw': True},
        name='waliki_version_raw'),
    url(r'^(?P<slug>[a-zA-Z0-9-\/]+)/version/(?P<version>[0-9a-f\^]{4,40})$', 'version', name='waliki_version'),

    url(r'^(?P<slug>[a-zA-Z0-9-\/]+)/diff/(?P<old>[0-9a-f\^]{4,40})\.\.(?P<new>[0-9a-f\^]{4,40})/raw$',
        'diff', {'raw': True}, name='waliki_diff_raw'),

    url(r'^(?P<slug>[a-zA-Z0-9-\/]+)/diff/(?P<old>[0-9a-f\^]{4,40})\.\.(?P<new>[0-9a-f\^]{4,40})$', 'diff', name='waliki_diff'),
)
{'fraction_non_alphanumeric': 0.3247394404827208, 'fraction_numerical': 0.039495337356006584, 'mean_word_length': 4.62962962962963, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '2927102', 'n_tokens_mistral': 879, 'n_tokens_neox': 817, 'n_words': 71}