def handleHTTPRequest(request, tableName, models):
  startTime = time.time()

  requestMethod = request.method

  resultsDict = None
  response = HttpResponse()
  statusCode = httpStatusCodes.BAD_REQUEST

  parseStatus, content = _altParseRequestBody(request, requestMethod)

  if parseStatus != httpStatusCodes.OK:
    statusCode = httpStatusCodes.BAD_REQUEST  
    resultsDict = {'msg': 'No body could be parsed'}
  else:
    tableProtoType = getTableByKey(tableName, models)

    if requestMethod == globVars.GET_KEY:
      statusCode, resultsDict = handleGET(content, tableProtoType, models)

    elif requestMethod == globVars.POST_KEY:
      statusCode, resultsDict = handlePOST(content, tableProtoType)

    elif requestMethod == globVars.DELETE_KEY:
      statusCode, resultsDict = handleDELETE(content, tableProtoType)

    elif requestMethod == globVars.PUT_KEY:
      statusCode, resultsDict = handlePUT(content, tableProtoType)
 
    else:
      resultsDict = {'msg': 'Unknown method'}
      statusCode = httpStatusCodes.METHOD_NOT_ALLOWED

  addTypeInfo(resultsDict)
  response.status_code = statusCode
  resultsDict['timeCost'] = startTime - time.time()

  response.write(json.dumps(resultsDict))

  return response
dataset/ETHPy150Open odeke-em/restAssured/api/crudAPI.py/handleHTTPRequest/swapped operands of `-`