<commit_before>module Atmosphere
  class Optimizer
    include Singleton

    # Runs optimization of resource allocation (i.e. virtual machines in cloud).
    # If hint is provided it is used to narrow the scope of optimization.
    # Hint can be provided in a hash with one of the following keys:
    # :appliance_id DB id of the appliance that was created. Optimization only akes care of finding a vm or creating a new one for given appliance.
    def run(hint)
      satisfy_appliance(hint[:created_appliance]) if hint[:created_appliance]
    end

    #private
    def satisfy_appliance(appliance)
      Atmosphere::Cloud::SatisfyAppliance.new(appliance).execute
    end

    def select_tmpl_and_flavor(tmpls, options={})
      tmpl_and_flavor = select_tmpls_and_flavors(tmpls, options).first
      [tmpl_and_flavor[:template], tmpl_and_flavor[:flavor]]
    end

    def select_tmpls_and_flavors(tmpls, options={})
      OptimizationStrategy::Default.select_tmpls_and_flavors(tmpls, options)
    end

    private

    def logger
      Atmosphere.optimizer_logger
    end
  end
end<commit_msg>Remove unused private optimizer method<commit_after>module Atmosphere
  class Optimizer
    include Singleton

    # Runs optimization of resource allocation (i.e. virtual machines in cloud).
    # If hint is provided it is used to narrow the scope of optimization.
    # Hint can be provided in a hash with one of the following keys:
    # :appliance_id DB id of the appliance that was created. Optimization only akes care of finding a vm or creating a new one for given appliance.
    def run(hint)
      satisfy_appliance(hint[:created_appliance]) if hint[:created_appliance]
    end

    #private
    def satisfy_appliance(appliance)
      Atmosphere::Cloud::SatisfyAppliance.new(appliance).execute
    end

    def select_tmpl_and_flavor(tmpls, options={})
      tmpl_and_flavor = select_tmpls_and_flavors(tmpls, options).first
      [tmpl_and_flavor[:template], tmpl_and_flavor[:flavor]]
    end

    def select_tmpls_and_flavors(tmpls, options={})
      OptimizationStrategy::Default.select_tmpls_and_flavors(tmpls, options)
    end
  end
end
{'fraction_non_alphanumeric': 0.06576492537313433, 'fraction_numerical': 0.0, 'mean_word_length': 3.908466819221968, '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': '6184095', 'n_tokens_mistral': 684, 'n_tokens_neox': 657, 'n_words': 198}