<commit_before>
# fix strange port numbers due to proxy
unless Rails.env.development?
  OmniAuth.config.full_host = 'https://openmensa.org'
end

OMNI_FILE = ENV['OMNI_FILE'] || Rails.root.join('config', 'omniauth.yml')
OMNI_CONFIG = YAML.load_file(OMNI_FILE)[Rails.env]

if OMNI_CONFIG
  Rails.application.config.middleware.use OmniAuth::Builder do
    provider :github, OMNI_CONFIG['github']['key'], OMNI_CONFIG['github']['secret'], skip_info: true if OMNI_CONFIG['github']
    provider :twitter, OMNI_CONFIG['twitter']['key'], OMNI_CONFIG['twitter']['secret'] if OMNI_CONFIG['twitter']
    provider :facebook, OMNI_CONFIG['facebook']['key'], OMNI_CONFIG['facebook']['secret'] if OMNI_CONFIG['facebook']
    provider :google_oauth2, OMNI_CONFIG['google_oauth2']['key'], OMNI_CONFIG['google_oauth2']['secret'] if OMNI_CONFIG['google_oauth2']
  end
end

OMNI_CONFIG.each do |key, data|
  Rails.configuration.omniauth_services ||= []
  Rails.configuration.omniauth_services << key
end
<commit_msg>Fix omniauth auth in specs<commit_after>
# fix strange port numbers due to proxy
if Rails.env.production?
  OmniAuth.config.full_host = 'https://openmensa.org'
end

OMNI_FILE = ENV['OMNI_FILE'] || Rails.root.join('config', 'omniauth.yml')
OMNI_CONFIG = YAML.load_file(OMNI_FILE)[Rails.env]

if OMNI_CONFIG
  Rails.application.config.middleware.use OmniAuth::Builder do
    provider :github, OMNI_CONFIG['github']['key'], OMNI_CONFIG['github']['secret'], skip_info: true if OMNI_CONFIG['github']
    provider :twitter, OMNI_CONFIG['twitter']['key'], OMNI_CONFIG['twitter']['secret'] if OMNI_CONFIG['twitter']
    provider :facebook, OMNI_CONFIG['facebook']['key'], OMNI_CONFIG['facebook']['secret'] if OMNI_CONFIG['facebook']
    provider :google_oauth2, OMNI_CONFIG['google_oauth2']['key'], OMNI_CONFIG['google_oauth2']['secret'] if OMNI_CONFIG['google_oauth2']
  end
end

OMNI_CONFIG.each do |key, data|
  Rails.configuration.omniauth_services ||= []
  Rails.configuration.omniauth_services << key
end

{'fraction_non_alphanumeric': 0.15515515515515516, 'fraction_numerical': 0.004004004004004004, 'mean_word_length': 7.2946058091286305, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5372187', 'n_tokens_mistral': 702, 'n_tokens_neox': 646, 'n_words': 124}