<commit_before>class Fibo < Sinatra::Base
  get '/fib/:num' do
    num = params[:num].to_i
    t1 = Time.now
    x =  fibo(num)
    t2 = Time.now
#    $stderr.puts("fibo(#{num}) => #{x}")
    return "fib(#{num}) => #{x} | #{t2 - t1} secs\n"
  end

  def fibo(num)
    # Deliberately slow.
    if num <= 0
      return 0
    elsif num == 1
      return 1
    end
    return fibo(num - 1) + fibo(num - 2)
  end
end<commit_msg>Allow fibo/ as well as fib/<commit_after>class Fibo < Sinatra::Base
  get '/fib/:num' do
    fiboWrapper
  end
  
  get '/fibo/:num' do
    fiboWrapper
  end
  
  def fiboWrapper
    num = params[:num].to_i
    t1 = Time.now
    x =  fibo(num)
    t2 = Time.now
    return "fib(#{num}) => #{x} | #{t2 - t1} secs\n"
  end
  
  get '/' do
    url = request.url
    url.chop! if url[-1] == '/'
    return "Usage: #{url}/fib/[NUMBER]"
  end

  def fibo(num)
    # Deliberately slow.
    if num <= 0
      return 0
    elsif num == 1
      return 1
    end
    return fibo(num - 1) + fibo(num - 2)
  end
end
{'fraction_non_alphanumeric': 0.15692007797270954, 'fraction_numerical': 0.02046783625730994, 'mean_word_length': 1.9682080924855492, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, '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': '1123852', 'n_tokens_mistral': 443, 'n_tokens_neox': 421, 'n_words': 112}