<commit_before>class Redi2casa
  # Supports only hashes now
  def hlen key
    response = @db_conn.execute("select count(*) from hashes where key = '#{key}'")
    parse_response(response, "count").to_i
  end
end<commit_msg>hlen to support counters<commit_after>class Redi2casa
  # Supports only hashes now
  def hlen key, type = "hash"
    if type == "hash"
      response = @db_conn.execute("select count(*) from hashes where key = '#{key}'")
      parse_response(response, "count").to_i
    elsif type == "counter"
      response = @db_conn.execute("select count(*) from counters where key = '#{key}'")
      parse_response(response, "count").to_i
    end
  end
end
{'fraction_non_alphanumeric': 0.12893553223388307, 'fraction_numerical': 0.0029985007496251873, 'mean_word_length': 3.911764705882353, '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': '5409620', 'n_tokens_mistral': 220, 'n_tokens_neox': 217, 'n_words': 63}