<commit_before>require 'sinatra/base'
require 'json'

class CalculatorApp < Sinatra::Base
  def initialize(path = nil)
    super

    @calculator_loader = CalculatorLoader.new(path)
  end

  def handle_request(endpoint, data)

  end

  def invalid_request_response
    { error: 400 }
  end

  def not_found_response
    { error: 404 }
  end

  def server_error_response<commit_msg>Pass app to sinatra<commit_after>require 'sinatra/base'
require 'json'

class CalculatorApp < Sinatra::Base
  def initialize(app, path = nil)
    super app

    @calculator_loader = CalculatorLoader.new(path)
  end

  def handle_request(endpoint, data)

  end

  def invalid_request_response
    { error: 400 }
  end

  def not_found_response
    { error: 404 }
  end

  def server_error_response
{'fraction_non_alphanumeric': 0.07335907335907337, 'fraction_numerical': 0.015444015444015444, 'mean_word_length': 3.7439024390243905, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5852825', 'n_tokens_mistral': 278, 'n_tokens_neox': 247, 'n_words': 64}