<commit_before>#Import google sign in
from google.appengine.ext import db

import webapp2
import json

import api



class Comments(webapp2.RequestHandler):

	def get(self):
		#TODO
		self.response.set_status(api.HTTP_NOT_IMPLEMENTED,"")
		self.response.write("{}")	

	def post(self):
		#TODO
		self.response.set_status(api.HTTP_NOT_IMPLEMENTED,"")
		self.response.write("{}")

		

application = webapp2.WSGIApplication([
    ('/api/comments', Comments),

], debug=True)<commit_msg>Began adding semantic and syntactic request checking to comments endpoint<commit_after>import webapp2
import json

import api


COMMENT_TYPES = ['FORUM', 'NEEDS', 'MESSAGE']

class Comments(webapp2.RequestHandler):

	def get(self):
		#Default status if none are set
		self.response.set_status(api.HTTP_NOT_IMPLEMENTED,"")

		#Check for optional parameters:
		commentType = self.request.get("type")
		if commentType:
			#We have an optional parameter. Is it well formed?
			if commentType.upper() in COMMENT_TYPES:
				#Yes it is well formed and we may execute a datastore query for the comments
				self.response.set_status(api.HTTP_OK,"")
			else:
				#Semantically incorrect query
				self.response.set_status(api.HTTP_REQUEST_SEMANTICS_PROBLEM,"")


		#TODO
		
		self.response.write("{}")	

	def post(self):
		#Confirm that all elements of the json are there.
		
		self.response.set_status(api.HTTP_NOT_IMPLEMENTED,"")
		self.response.write("{}")

		

application = webapp2.WSGIApplication([
    ('/api/comments', Comments),

], debug=True)
{'fraction_non_alphanumeric': 0.11672131147540983, 'fraction_numerical': 0.003934426229508197, 'mean_word_length': 4.569343065693431, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7100061', 'n_tokens_mistral': 552, 'n_tokens_neox': 495, 'n_words': 122}