<commit_before>
require "escape_utils"


module Escape_All

  module Sinatra
    def params
      if !@clean_params
        dirty = super
        if dirty.empty?
          return dirty
        end
      end

      o = {}
      dirty = super
      super.keys.each do |k|
        o[Escape_All.escape(k.to_s).to_sym] = Escape_All.escape(dirty[k])
      end
      o
    end
  end # === module

  class << self

    def e o
      EscapeUtils.escape_html(EscapeUtils.unescape_html(o))
    end

    def escape o
      if o.kind_of? Array

        return o.map do |v|
          Escape_All.e(v)
        end<commit_msg>Refactored: less likely for bugs<commit_after>
require "escape_utils"


module Escape_All

  module Sinatra
    def params
      @clean_params ||= begin
                          dirty = super
                          return dirty if dirty.empty?

                          o = {}
                          super.keys.each do |k|
                            o[Escape_All.escape(k.to_s).to_sym] = Escape_All.escape(dirty[k])
                          end

                          o
                        end
    end
  end # === module

  class << self

    def e o
      EscapeUtils.escape_html(EscapeUtils.unescape_html(o))
    end

    def escape o
      if o.kind_of? Array

        return o.map do |v|
          Escape_All.e(v)
        end
{'fraction_non_alphanumeric': 0.07669616519174041, 'fraction_numerical': 0.0, 'mean_word_length': 1.3196581196581196, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4089934', 'n_tokens_mistral': 428, 'n_tokens_neox': 413, 'n_words': 102}