def process_request(self, req, resp):
		if req.content_length in (None, 0):
			# Nothing to do
			return

		body = req.stream.read()
		if not body:
			raise falcon.HTTPBadRequest('Empty request body',
				'A valid JSON document is required.')

		try:
			req.context['doc'] = json.loads(body.decode('utf-8'))

		except (__HOLE__, UnicodeDecodeError):
			raise falcon.HTTPError(falcon.HTTP_753,
				'Malformed JSON',
				'Could not decode the request body. The '
				'JSON was incorrect or not encoded as '
				'UTF-8.')

		# did they pass text var
		if 'text' not in req.context['doc']:
			raise falcon.HTTPBadRequest(
				'Error',
				'Missing json var text, come on you had one var to pass')

		# did they pass an empty text var
		if not req.context['doc']['text']:
			raise falcon.HTTPBadRequest(
				'Error',
				'Missing empty var text, come on you had one var to pass')
dataset/ETHPy150Open mikelynn2/sentimentAPI/sentimentAPI.py/JSONTranslator.process_request