<commit_before>class VimEat < Sinatra::Base
	# List all restaurants
	get '/restaurants' do
		content_type :json
		restaurants = JSON.parse(get_json_all('restaurant'))
		JSON.pretty_generate(restaurants)
	end

	# Create a new restaurant
	post '/restaurants' do
		# Generates random string id for the new restaurant
		id = ('A'..'Z').to_a.shuffle[0,10].join
		# Add a random id
		json_request = {'id' => id}.merge(JSON.parse(request.body.read))

		f = get_json_all('restaurant')
		f = '{"restaurants":[]}' if f.empty?
		json_obj = JSON.parse(f)

		tmp = {}
		tmp['restaurants'] = json_obj['restaurants'].unshift(json_request)
		update_json('restaurant', tmp)
		200
	end

	# Method to delete a key from the restaurants hash
	# delete '/restaurants/key' do
	# 	f = get_json_all('restaurant')
	# 	f = JSON.parse(f)
	# 	tmp = {}
	# 	tmp['restaurants'] = []

	# 	f['restaurants'].each do |r|
	# 		tmp['restaurants'].push(r.delete_if { |key, value| key == '<key_name>'})
	# 	end
	# 	update_json('restaurant', tmp)
	# 	200
	# end

	# Convert all restaurant.img to array
	# get '/restaurants/array' do
	# 	j = JSON.parse(get_json_all('restaurant'))
	# 	j['restaurants'].each do |r|
	# 		arr = [r['img']]
	# 		r['img'] = arr
	# 	end
	# 	update_json('restaurant', j)
	# end
end<commit_msg>Remove two example APIs in code<commit_after>class VimEat < Sinatra::Base
	# List all restaurants
	get '/restaurants' do
		content_type :json
		restaurants = JSON.parse(get_json_all('restaurant'))
		JSON.pretty_generate(restaurants)
	end

	# Create a new restaurant
	post '/restaurants' do
		# Generates random string id for the new restaurant
		id = ('A'..'Z').to_a.shuffle[0,10].join
		# Add a random id
		json_request = {'id' => id}.merge(JSON.parse(request.body.read))

		f = get_json_all('restaurant')
		f = '{"restaurants":[]}' if f.empty?
		json_obj = JSON.parse(f)

		tmp = {}
		tmp['restaurants'] = json_obj['restaurants'].unshift(json_request)
		update_json('restaurant', tmp)
		200
	end
end
{'fraction_non_alphanumeric': 0.15672396359959556, 'fraction_numerical': 0.007583417593528817, 'mean_word_length': 4.113695090439276, 'pattern_counts': {'":': 2, '<': 6, '<?xml version=': 0, '>': 6, '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': '6235439', 'n_tokens_mistral': 817, 'n_tokens_neox': 755, 'n_words': 166}