<commit_before>require 'phantomjs/poltergeist'
require 'time'

module Happy
  module XCoin
    Capybara.register_driver(:poltergeist_proxy) do |app|
      Capybara::Poltergeist::Driver.new(
        app,
        phantomjs: Phantomjs.path,
        js_errors: false,
        timeout: 90,
        phantomjs_options: [
          '--load-images=no',
          "--proxy=#{ENV['XCOIN_PROXY']}",
          "--proxy-auth=#{ENV['XCOIN_PROXY_AUTH']}"
        ]
      )
    end<commit_msg>Modify the proxy as an option<commit_after>require 'phantomjs/poltergeist'
require 'time'

module Happy
  module XCoin
    PHANTOMJS_OPTIONS = [
      '--load-images=no'
    ]
    PHANTOMJS_OPTIONS.push("--proxy=#{ENV['XCOIN_PROXY']}") unless
      ENV['XCOIN_PROXY'].nil? || ENV['XCOIN_PROXY'].empty?
    PHANTOMJS_OPTIONS.push("--proxy-auth=#{ENV['XCOIN_PROXY_AUTH']}") unless
      ENV['XCOIN_PROXY_AUTH'].nil? || ENV['XCOIN_PROXY_AUTH'].empty?
    Capybara.register_driver(:poltergeist_proxy) do |app|
      Capybara::Poltergeist::Driver.new(
        app,
        phantomjs: Phantomjs.path,
        js_errors: false,
        timeout: 90,
        phantomjs_options: PHANTOMJS_OPTIONS
      )
    end
{'fraction_non_alphanumeric': 0.13837011884550085, 'fraction_numerical': 0.003395585738539898, 'mean_word_length': 2.9696969696969697, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2836352', 'n_tokens_mistral': 442, 'n_tokens_neox': 433, 'n_words': 60}