<commit_before># encoding: UTF-8
require 'winrm'
require 'winrm-elevated'
require_relative 'matchers'

# Creates a WinRM connection for integration tests
module ConnectionHelper
  def winrm_connection
    WinRM::WinRMWebService.new(
      winrm_config['endpoint'],
      winrm_config['auth_type'].to_sym,
      user: username,
      pass: password,
      basic_auth_only: true)
  end

  def elevated_runner
    @elevated_runner ||= WinRM::Elevated::Runner.new(winrm_connection)
  end

  def winrm_config
    unless @winrm_config
      path = File.expand_path("#{File.dirname(__FILE__)}/config.yml")
      unless File.exist?(path)
        path = File.expand_path("#{File.dirname(__FILE__)}/config-example.yml")
      end
      @winrm_config = YAML.load(File.read(path))
      @winrm_config[:endpoint] = ENV['winrm_endpoint'] if ENV['winrm_endpoint']
    end
    @winrm_config
  end
<commit_msg>use string key for winrm endpoint<commit_after># encoding: UTF-8
require 'winrm'
require 'winrm-elevated'
require_relative 'matchers'

# Creates a WinRM connection for integration tests
module ConnectionHelper
  def winrm_connection
    WinRM::WinRMWebService.new(
      winrm_config['endpoint'],
      winrm_config['auth_type'].to_sym,
      user: username,
      pass: password,
      basic_auth_only: true)
  end

  def elevated_runner
    @elevated_runner ||= WinRM::Elevated::Runner.new(winrm_connection)
  end

  def winrm_config
    unless @winrm_config
      path = File.expand_path("#{File.dirname(__FILE__)}/config.yml")
      unless File.exist?(path)
        path = File.expand_path("#{File.dirname(__FILE__)}/config-example.yml")
      end
      @winrm_config = YAML.load(File.read(path))
      @winrm_config['endpoint'] = ENV['winrm_endpoint'] if ENV['winrm_endpoint']
    end
    @winrm_config
  end

{'fraction_non_alphanumeric': 0.11344770337576093, 'fraction_numerical': 0.0011068068622025456, 'mean_word_length': 3.9130434782608696, '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': '766638', 'n_tokens_mistral': 605, 'n_tokens_neox': 592, 'n_words': 115}