<commit_before>from django.conf.urls.defaults import patterns, url
from piston.doc import documentation_view
from api.handlers import (RunHandler, UserHandler, MapHandler,
	PingHandler, FileUploadHandler)
from lib.piston_utils import APIKeyAuthentication
from lib.piston_utils import Resource

auth = APIKeyAuthentication(realm="Teerace")
run_resource = Resource(RunHandler, authentication=auth)
user_resource = Resource(UserHandler, authentication=auth)
map_resource = Resource(MapHandler, authentication=auth)
ping_resource = Resource(PingHandler, authentication=auth)
file_resource = Resource(FileUploadHandler, authentication=auth)

# 1st revision of API
urlpatterns = patterns('',
	url(r'^1/runs/detail/(?P<id>\d+)/$', run_resource, {'action': 'detail'},
		name='api_runs_detail'),
	url(r'^1/runs/(?P<action>\w+)/(?P<id>\d+)/$', run_resource, name='api_runs'),
	url(r'^1/runs/(?P<action>\w+)/$', run_resource, name='api_runs'),
	url(r'^1/users/detail/(?P<id>\d+)/$', user_resource, {'action': 'detail'},
		name='api_users_detail'),
	url(r'^1/users/(?P<action>\w+)/(?P<id>\d+)/(?P<map_id>\d+)/$',
		user_resource, name='api_users'),
	url(r'^1/users/(?P<action>\w+)/(?P<id>\d+)/$', user_resource,
		name='api_users'),
	url(r'^1/users/(?P<action>\w+)/$', user_resource, name='api_users'),
	url(r'^1/maps/detail/(?P<map_id>\d+)/$', map_resource, {'action': 'detail'},
		name='api_maps_detail'),
	url(r'^1/maps/(?P<action>\w+)/(?P<map_id>\d+)/(?P<offset>\d+)/$', map_resource,
		name='api_maps'),
	url(r'^1/maps/(?P<action>\w+)/(?P<map_id>\d+)/$', map_resource,
		name='api_maps'),
	url(r'^1/maps/(?P<action>\w+)/$', map_resource, name='api_maps'),
	url(r'^1/files/(?P<file_type>\w+)/(?P<user_id>\d+)/(?P<map_id>\d+)/$', filte_resource,
		name='api_files'),
	url(r'^1/ping/$', ping_resource, {'action': 'ping'}, name='api_ping_post'),
	url(r'^1/hello/$', ping_resource, {'action': 'hello'}, name='api_ping'),
	# automated documentation
	url(r'^1/docs/$', documentation_view, name='api_docs'),
)<commit_msg>fixed typo<commit_after>from django.conf.urls.defaults import patterns, url
from piston.doc import documentation_view
from api.handlers import (RunHandler, UserHandler, MapHandler,
	PingHandler, FileUploadHandler)
from lib.piston_utils import APIKeyAuthentication
from lib.piston_utils import Resource

auth = APIKeyAuthentication(realm="Teerace")
run_resource = Resource(RunHandler, authentication=auth)
user_resource = Resource(UserHandler, authentication=auth)
map_resource = Resource(MapHandler, authentication=auth)
ping_resource = Resource(PingHandler, authentication=auth)
file_resource = Resource(FileUploadHandler, authentication=auth)

# 1st revision of API
urlpatterns = patterns('',
	url(r'^1/runs/detail/(?P<id>\d+)/$', run_resource, {'action': 'detail'},
		name='api_runs_detail'),
	url(r'^1/runs/(?P<action>\w+)/(?P<id>\d+)/$', run_resource, name='api_runs'),
	url(r'^1/runs/(?P<action>\w+)/$', run_resource, name='api_runs'),
	url(r'^1/users/detail/(?P<id>\d+)/$', user_resource, {'action': 'detail'},
		name='api_users_detail'),
	url(r'^1/users/(?P<action>\w+)/(?P<id>\d+)/(?P<map_id>\d+)/$',
		user_resource, name='api_users'),
	url(r'^1/users/(?P<action>\w+)/(?P<id>\d+)/$', user_resource,
		name='api_users'),
	url(r'^1/users/(?P<action>\w+)/$', user_resource, name='api_users'),
	url(r'^1/maps/detail/(?P<map_id>\d+)/$', map_resource, {'action': 'detail'},
		name='api_maps_detail'),
	url(r'^1/maps/(?P<action>\w+)/(?P<map_id>\d+)/(?P<offset>\d+)/$', map_resource,
		name='api_maps'),
	url(r'^1/maps/(?P<action>\w+)/(?P<map_id>\d+)/$', map_resource,
		name='api_maps'),
	url(r'^1/maps/(?P<action>\w+)/$', map_resource, name='api_maps'),
	url(r'^1/files/(?P<file_type>\w+)/(?P<user_id>\d+)/(?P<map_id>\d+)/$', file_resource,
		name='api_files'),
	url(r'^1/ping/$', ping_resource, {'action': 'ping'}, name='api_ping_post'),
	url(r'^1/hello/$', ping_resource, {'action': 'hello'}, name='api_ping'),
	# automated documentation
	url(r'^1/docs/$', documentation_view, name='api_docs'),
)
{'fraction_non_alphanumeric': 0.23802395209580837, 'fraction_numerical': 0.007984031936127744, 'mean_word_length': 7.640086206896552, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, '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': '6570518', 'n_tokens_mistral': 1606, 'n_tokens_neox': 1528, 'n_words': 211}