<commit_before>require "rspec"
require "capybara"
require "capybara/rspec" # Required here instead of in rspec_spec to avoid RSpec deprecation warning
require "capybara/spec/test_app"
require "capybara/spec/spec_helper"
require "nokogiri"

module Capybara
  module SpecHelper
    class << self
      def configure(config)
        filter = lambda do |requires, metadata|
          if requires and metadata[:skip]
            requires.any? do |require|
              metadata[:skip].include?(require)
            end
          else
            false
          end
        end
        config.filter_run_excluding :requires => filter
        config.before do
          Capybara.app = TestApp
          Capybara.app_host = nil

          Capybara.configure do |config|
            config.default_selector = :xpath
          end

          Capybara.default_wait_time = 1
        end
      end<commit_msg>Reset both before and after examples<commit_after>require "rspec"
require "capybara"
require "capybara/rspec" # Required here instead of in rspec_spec to avoid RSpec deprecation warning
require "capybara/spec/test_app"
require "capybara/spec/spec_helper"
require "nokogiri"

module Capybara
  module SpecHelper
    class << self
      def configure(config)
        filter = Proc.new do |requires, metadata|
          if requires and metadata[:skip]
            requires.any? do |require|
              metadata[:skip].include?(require)
            end
          else
            false
          end
        end
        config.filter_run_excluding :requires => filter
        reset = Proc.new do
          Capybara.app = TestApp
          Capybara.app_host = nil
          Capybara.default_selector = :xpath
          Capybara.default_wait_time = 1
        end
        config.before(:each, &reset)
        config.after(:each, &reset)
      end
{'fraction_non_alphanumeric': 0.07119565217391305, 'fraction_numerical': 0.0010869565217391304, 'mean_word_length': 2.141638225255973, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5302719', 'n_tokens_mistral': 522, 'n_tokens_neox': 509, 'n_words': 141}