<commit_before>class MiqEventDefinitionSet < ActiveRecord::Base
  acts_as_miq_set

  default_scope { where conditions_for_my_region_default_scope }

  FIXTURE_DIR = Rails.root.join("db/fixtures")

  def self.seed
    CSV.foreach(FIXTURE_DIR.join("#{to_s.pluralize.underscore}.csv"), :headers => true, :skip_lines => /^#/) do |csv_row|
      set = csv_row.to_hash.symbolize_keys

      rec = find_by_name(set[:name])
      if rec.nil?
        _log.info("Creating [#{set[:name]}]")
        rec = create!(set)
      else
        rec.attributes = set
        if rec.changed?
          _log.info("Updating [#{set[:name]}]")
          rec.save!
        end<commit_msg>No need to symbolize keys<commit_after>class MiqEventDefinitionSet < ActiveRecord::Base
  acts_as_miq_set

  default_scope { where conditions_for_my_region_default_scope }

  FIXTURE_DIR = Rails.root.join("db/fixtures")

  def self.seed
    CSV.foreach(FIXTURE_DIR.join("#{to_s.pluralize.underscore}.csv"), :headers => true, :skip_lines => /^#/) do |csv_row|
      set = csv_row.to_hash

      rec = find_by_name(set['name'])
      if rec.nil?
        _log.info("Creating [#{set['name']}]")
        rec = create!(set)
      else
        rec.attributes = set
        if rec.changed?
          _log.info("Updating [#{set['name']}]")
          rec.save!
        end
{'fraction_non_alphanumeric': 0.1404833836858006, 'fraction_numerical': 0.0, 'mean_word_length': 2.967065868263473, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7134811', 'n_tokens_mistral': 469, 'n_tokens_neox': 452, 'n_words': 75}