<commit_before>Spree::BaseController.class_eval do
  before_filter :set_connection
  
  def set_connection
    config = Spree::MultiVendor::Config
    
    database = config.database_prefix + request.host.gsub('.', '_')
    databases = []
    IO.popen("mysql -u #{config.username} -p#{config.password}<< EOF
      show databases;
      exit
    EOF") do |pipe|
      databases = pipe.read.split("\n")
    end
    databases = []
    if databases.include? database
      ActiveRecord::Base.establish_connection(
        :adapter => config.adapter,
        :database => database,
        :username => config.username,
        :password => <PASSWORD>,
        :host => config.host
      )
    else<commit_msg>fix typo<commit_after>Spree::BaseController.class_eval do
  before_filter :set_connection
  
  def set_connection
    config = Spree::MultiVendor::Config
    
    database = config.database_prefix + request.host.gsub('.', '_')
    databases = []
    IO.popen("mysql -u #{config.username} -p#{config.password}<< EOF
      show databases;
      exit
    EOF") do |pipe|
      databases = pipe.read.split("\n")
    end
    
    if databases.include? database
      ActiveRecord::Base.establish_connection(
        :adapter => config.adapter,
        :database => database,
        :username => config.username,
        :password => <PASSWORD>,
        :host => config.host
      )
    else
{'fraction_non_alphanumeric': 0.12724658519051044, 'fraction_numerical': 0.0, 'mean_word_length': 2.625, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '4430801', 'n_tokens_mistral': 417, 'n_tokens_neox': 410, 'n_words': 83}