<commit_before>module Initializable
  def initialize(params = {})
    # So this is a ruby meta-programming method, basically anytime that you call initialize with a series of params like so
    # Object.new(id: "1234", some_property: "foobar")
    # Then for each of those params we'll iterate those and call the associated setter method. In this example this method would call the methods id=, and some_property=.
    # Now, this is where it kind of gets strange because you'll notice in user.rb and card.rb I do not define any methods like this.
    # That's where attr_accessor comes in. This method allows for a shorthand for generating getters/setters.
    params.each do |key, value|
      setter = "#{key}="
      send(setter, value) if respond_to?(setter.to_sym, false)

      # Handle camel case parameters
      setter = "#{key.underscore}="
      send(setter, value) if respond_to?(setter.to_sym, false)
    end
  end
end<commit_msg>Fix symbol underscore bug (#2716)<commit_after>module Initializable
  def initialize(params = {})
    # So this is a ruby meta-programming method, basically anytime that you call initialize with a series of params like so
    # Object.new(id: "1234", some_property: "foobar")
    # Then for each of those params we'll iterate those and call the associated setter method. In this example this method would call the methods id=, and some_property=.
    # Now, this is where it kind of gets strange because you'll notice in user.rb and card.rb I do not define any methods like this.
    # That's where attr_accessor comes in. This method allows for a shorthand for generating getters/setters.
    params.each do |key, value|
      setter = "#{key}="
      send(setter, value) if respond_to?(setter.to_sym, false)

      # Handle camel case parameters
      setter = "#{key.to_s.underscore}="
      send(setter, value) if respond_to?(setter.to_sym, false)
    end
  end
end
{'fraction_non_alphanumeric': 0.08154730789336122, 'fraction_numerical': 0.006272869837950863, 'mean_word_length': 3.6231884057971016, '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': '6586275', 'n_tokens_mistral': 566, 'n_tokens_neox': 537, 'n_words': 239}