<commit_before># frozen_string_literal: true

module ManageIQ::Providers::Amazon::InstanceTypes
  ALL_TYPES = YAML.load_file(
    ManageIQ::Providers::Amazon::Engine.root.join('db/fixtures/aws_instance_types.yml')
  ).each_value(&:freeze).freeze

  # Types that are still advertised, but not recommended for new instances.
  DEPRECATED_TYPES = ALL_TYPES.select do |_, attrs|
    attrs[:deprecated] && !attrs[:discontinued]
  end.to_h.freeze

  # Types that are no longer advertised
  DISCONTINUED_TYPES = ALL_TYPES.select do |_, attrs|
    !attrs[:deprecated] && attrs[:discontinued]
  end.to_h.freeze

  # Types that are currently advertised for use
  AVAILABLE_TYPES = ALL_TYPES.except(*(DEPRECATED_TYPES.keys + DISCONTINUED_TYPES.keys)).freeze

  def self.instance_types
    additional = Hash(Settings.ems.ems_amazon.try!(:additional_instance_types)).stringify_keys
    disabled = Array(Settings.ems.ems_amazon.try!(:disabled_instance_types))
    ALL_TYPES.merge(additional).except(*disabled)
  end

  def self.all
    instance_types.values
  end

  def self.names
    instance_types.keys
  end
end<commit_msg>remove all freezing as requested<commit_after># frozen_string_literal: true

module ManageIQ::Providers::Amazon::InstanceTypes
  ALL_TYPES = YAML.load_file(
    ManageIQ::Providers::Amazon::Engine.root.join('db/fixtures/aws_instance_types.yml')
  )

  # Types that are still advertised, but not recommended for new instances.
  DEPRECATED_TYPES = ALL_TYPES.select do |_, attrs|
    attrs[:deprecated] && !attrs[:discontinued]
  end.to_h

  # Types that are no longer advertised
  DISCONTINUED_TYPES = ALL_TYPES.select do |_, attrs|
    !attrs[:deprecated] && attrs[:discontinued]
  end.to_h

  # Types that are currently advertised for use
  AVAILABLE_TYPES = ALL_TYPES.except(*(DEPRECATED_TYPES.keys + DISCONTINUED_TYPES.keys))

  def self.instance_types
    additional = Hash(Settings.ems.ems_amazon.try!(:additional_instance_types)).stringify_keys
    disabled = Array(Settings.ems.ems_amazon.try!(:disabled_instance_types))
    ALL_TYPES.merge(additional).except(*disabled)
  end

  def self.all
    instance_types.values
  end

  def self.names
    instance_types.keys
  end
end
{'fraction_non_alphanumeric': 0.10245901639344263, 'fraction_numerical': 0.0, 'mean_word_length': 4.970108695652174, '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': '2647952', 'n_tokens_mistral': 746, 'n_tokens_neox': 736, 'n_words': 136}