<commit_before>require 'open-uri'
require 'uri'
require 'openssl'

Given(/^any non\-static resource$/) do
  pending # express the regexp above with the code you wish you had
end

Given(/^I navigate to any non-static page$/) do
  # page = ['I am on the Systems page', 'I am on the Systems overview page of this client'].sample
  page = ['I am on the Systems page'].sample
  step(page)
end

Given(/^I retrieve any static resource$/) do
  resource = ['/img/action-add.gif', '/css/spacewalk.css', '/fonts/DroidSans.ttf',
              '/javascript/actionchain.js'].sample
  visit Capybara.app_host + resource
end

And(/^the response header "(.*?)" should be "(.*?)"$/) do |arg1, arg2|
  begin
    assert_equal(Capybara.current_session.response_headers[arg1], arg2)
  rescue Capybara::NotSupportedByDriverError => e
    pending('Current driver does not support checking response headers')
  end
end

Then(/^the response header "(.*?)" should include "(.*?)"$/) do |arg1, arg2|
  begin
    assert_includes(Capybara.current_session.response_headers[arg1], arg2)
  rescue Capybara::NotSupportedByDriverError => e
    pending('Current driver does not support checking response headers')
  end
end
<commit_msg>exception variable not needed<commit_after>require 'open-uri'
require 'uri'
require 'openssl'

Given(/^any non\-static resource$/) do
  pending # express the regexp above with the code you wish you had
end

Given(/^I navigate to any non-static page$/) do
  page = ['I am on the Systems page'].sample
  step(page)
end

Given(/^I retrieve any static resource$/) do
  resource = ['/img/action-add.gif', '/css/spacewalk.css', '/fonts/DroidSans.ttf',
              '/javascript/actionchain.js'].sample
  visit Capybara.app_host + resource
end

And(/^the response header "(.*?)" should be "(.*?)"$/) do |arg1, arg2|
  begin
    assert_equal(Capybara.current_session.response_headers[arg1], arg2)
  rescue Capybara::NotSupportedByDriverError
    pending('Current driver does not support checking response headers')
  end
end

Then(/^the response header "(.*?)" should include "(.*?)"$/) do |arg1, arg2|
  begin
    assert_includes(Capybara.current_session.response_headers[arg1], arg2)
  rescue Capybara::NotSupportedByDriverError
    pending('Current driver does not support checking response headers')
  end
end

{'fraction_non_alphanumeric': 0.129172084958821, 'fraction_numerical': 0.006935413957520589, 'mean_word_length': 4.293577981651376, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6191294', 'n_tokens_mistral': 710, 'n_tokens_neox': 705, 'n_words': 222}