<commit_before>require "sinatra/base"
require "sinatra_auth_github"
module Descartes
  class GithubAuth < Sinatra::Base

    def self.fetch_env(key)
      ENV.fetch(key) { raise "No ENV var named #{key.inspect}" }
    end

    set :github_options, {
      :secret    => fetch_env('GITHUB_CLIENT_SECRET'),
      :client_id => fetch_env('GITHUB_CLIENT_ID'),
      :org_id    => fetch_env('GITHUB_ORG_ID'),
    }

    register Sinatra::Auth::Github

    before do
      unless github_user
        github_organization_authenticate!(settings.github_options[:org_id])
        github_callback
      end
    end

    def github_callback
      unless session['user']<commit_msg>since this file is loaded from config.ru, cant use fetch.<commit_after>require "sinatra/base"
require "sinatra_auth_github"
module Descartes
  class GithubAuth < Sinatra::Base

    set :github_options, {
      :secret    => ENV['GITHUB_CLIENT_SECRET'],
      :client_id => ENV['GITHUB_CLIENT_ID'],
      :org_id    => ENV['GITHUB_ORG_ID'],
    }

    register Sinatra::Auth::Github

    before do
      unless github_user
        github_organization_authenticate!(settings.github_options[:org_id])
        github_callback
      end
    end

    def github_callback
      unless session['user']
{'fraction_non_alphanumeric': 0.09904912836767037, 'fraction_numerical': 0.0, 'mean_word_length': 3.295918367346939, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '7363521', 'n_tokens_mistral': 421, 'n_tokens_neox': 402, 'n_words': 80}