<commit_before>local resource = require "cosy.server.resource"

local Perform = {}

function Perform.request (context)
  local request  = context.request
  local response = context.response
  local r       = resource (context)
  for _, k in ipairs (request.resource) do
    r = r [k]
    if r == nil then
      error {
        code    = 404,
        message = "Not Found",
      }
    end
  end
  local method = r [request.method]
  if not method then
    error {
      code    = 405,
      message = "Method Not Allowed",<commit_msg>Cosmetic.<commit_after>local resource = require "cosy.server.resource"

local Perform = {}

function Perform.request (context)
  local request  = context.request
  local response = context.response
  local r        = resource (context)
  for _, k in ipairs (request.resource) do
    r = r [k]
    if r == nil then
      error {
        code    = 404,
        message = "Not Found",
      }
    end
  end
  local method = r [request.method]
  if not method then
    error {
      code    = 405,
      message = "Method Not Allowed",
{'fraction_non_alphanumeric': 0.09295774647887324, 'fraction_numerical': 0.011267605633802818, 'mean_word_length': 2.2401215805471124, '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': '5816586', 'n_tokens_mistral': 333, 'n_tokens_neox': 320, 'n_words': 109}