<commit_before>module Helper
  def precise(hash, decimal)
    num_data = ["rate", "mxn", "btc", "fee", "mxn_balance", "btc_balance",
      "mxn_reserved", "btc_reserved", "mxn_available", "btc_available",
      "amount", "price", "bid", "ask", "last", "high", "low", "vwap", "volume"]

    if decimal
      hash.each { |k, v| hash[k] = BigDecimal.new(v) if num_data.include? k.id2name }
    else
      hash.each { |k, v| hash[k] = v.to_f if num_data.include? k.id2name }
    end
  end

  def symbolize_keys(hash)
    hash.inject({}) { |result, (key, value)|
      new_key = case key when String then key.to_sym else key end
      new_value = case value when Hash then symbolize_keys(value) else value end<commit_msg>Refactor<commit_after>module Helper
  def precise(hash, decimal)
    num_data = ["rate", "mxn", "btc", "fee", "mxn_balance", "btc_balance",
      "mxn_reserved", "btc_reserved", "mxn_available", "btc_available",
      "amount", "price", "bid", "ask", "last", "high", "low", "vwap", "volume"]

    hash.each do |k,v|
      if num_data.include? k.id2name
        hash[k] = decimal ? BigDecimal.new(v) : v.to_f
      end
    end
  end

  def symbolize_keys(hash)
    hash.inject({}) { |result, (key, value)|
      new_key = case key when String then key.to_sym else key end
      new_value = case value when Hash then symbolize_keys(value) else value end
{'fraction_non_alphanumeric': 0.15508412582297001, 'fraction_numerical': 0.0021945866861741038, 'mean_word_length': 3.5448504983388704, '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': '2314629', 'n_tokens_mistral': 499, 'n_tokens_neox': 490, 'n_words': 135}