<commit_before>current_directory = File.dirname(__FILE__)
require File.join(current_directory, 'init')

require 'rubygems'
require 'sinatra'
require 'erb'
require 'resolv'

get '/' do
  erb :main
end

post '/' do
  tempfile = params[:file][:tempfile]
  
  traffic_calculator = TrafficCalculator.new tempfile.path, '192.168.127.12'
  traffic_calculator.calculate!
  @result_string = traffic_calculator.results_string

  @data = get_results params[:logsfile][:tempfile].path

  erb :results
end

get '/resolve/:ip' do
  resolver = Resolv::DNS.new
  resolver.getname(params[:ip])
end<commit_msg>A little bug fixed in server.rb<commit_after>#!/usr/bin/ruby

current_directory = File.dirname(__FILE__)
require File.join(current_directory, 'init')

require 'rubygems'
require 'sinatra'
require 'erb'
require 'resolv'

get '/' do
  erb :main
end

post '/' do
  tempfile = params[:file][:tempfile]

  traffic_calculator = TrafficCalculator.new tempfile.path, '192.168.127.12'
  traffic_calculator.calculate!
  @result_string = traffic_calculator.results_string

  @data = get_results params[:logsfile][:tempfile].path

  erb :results
end

get '/resolve/:ip' do
  resolver = Resolv::DNS.new
  resolver.getname(params[:ip]).to_s
end
{'fraction_non_alphanumeric': 0.12684124386252046, 'fraction_numerical': 0.01800327332242226, 'mean_word_length': 5.271794871794872, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5024702', 'n_tokens_mistral': 457, 'n_tokens_neox': 435, 'n_words': 89}