<commit_before>require 'sinatra'
require 'json'

require 'sinatra/reloader' if development?

source_list = ["The_Prince","Discources_On_Livy","The_Woman_of_Andros_Part_1","Clizia","The_Mandrake"]

get '/' do
	"Beep Boop. I am a simple API. I have these endpoints: <br/><br/>"+ 
	"<dt><code>/source_list</code> <dd>query list of available sources</dt>"+
	"<dt><code>/sources/{source}</code> <dd>get information for a source</dt>"
end

get '/source_list' do
	content_type :json
	source_list.to_json
end

get '/source/:source' do
	content_type :json
sleep 0.1	
	[:start, :stop, :step].each do |p|
		return { error: "Must provide #{p}"}.to_json unless params[p]<commit_msg>remove forced sleep on simple endpoint<commit_after>require 'sinatra'
require 'json'

require 'sinatra/reloader' if development?

source_list = ["The_Prince","Discources_On_Livy","The_Woman_of_Andros_Part_1","Clizia","The_Mandrake"]

get '/' do
	"Beep Boop. I am a simple API. I have these endpoints: <br/><br/>"+ 
	"<dt><code>/source_list</code> <dd>query list of available sources</dt>"+
	"<dt><code>/sources/{source}</code> <dd>get information for a source</dt>"
end

get '/source_list' do
	content_type :json
	source_list.to_json
end

get '/source/:source' do
	content_type :json
	[:start, :stop, :step].each do |p|
		return { error: "Must provide #{p}"}.to_json unless params[p]
{'fraction_non_alphanumeric': 0.16198224852071005, 'fraction_numerical': 0.0029585798816568047, 'mean_word_length': 5.632352941176471, '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': '4892820', 'n_tokens_mistral': 500, 'n_tokens_neox': 492, 'n_words': 128}