<commit_before>module Akephalos
  def self.configuration
    @configuration ||= {}
  end

  def self.configuration=(config)
    @configuration = config
  end

  module Filters
    def filters
      configuration[:filters] ||= []
    end

    def filter(method, regex, options = {})
      regex = Regexp.new(Regexp.escape(regex)) if regex.is_a?(String)
      filters << {:method => method, :filter => regex, :status => 200, :body => "", :headers => {}}.merge!(options)
    end
  end

  extend Filters<commit_msg>Refactor configuration getter and setter<commit_after>module Akephalos

  @configuration = {}

  class << self
    attr_accessor :configuration
  end

  module Filters
    def filters
      configuration[:filters] ||= []
    end

    def filter(method, regex, options = {})
      regex = Regexp.new(Regexp.escape(regex)) if regex.is_a?(String)
      filters << {:method => method, :filter => regex, :status => 200, :body => "", :headers => {}}.merge!(options)
    end
  end

  extend Filters
{'fraction_non_alphanumeric': 0.13972055888223553, 'fraction_numerical': 0.005988023952095809, 'mean_word_length': 3.3047210300429186, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '7634684', 'n_tokens_mistral': 315, 'n_tokens_neox': 297, 'n_words': 78}