<commit_before>FactoryGirl.define do
  factory :host do
    sequence(:name)     { |n| "host_#{seq_padded_for_sorting(n)}" }
    sequence(:hostname) { |n| "host_#{seq_padded_for_sorting(n)}" }
    vmm_vendor          "vmware"
    ipaddress           "127.0.0.1"
    user_assigned_os    "linux_generic"
    power_state         "on"
  end

  factory :host_with_ref, :parent => :host do
    sequence(:ems_ref)     { |n| "host-#{seq_padded_for_sorting(n)}" }
    sequence(:ems_ref_obj) { |n| VimString.new("host-#{seq_padded_for_sorting(n)}", "HostSystem", "ManagedObjectReference") }
  end

  factory :host_with_authentication, :parent => :host do
    after(:create) do |x|
      x.authentications = [FactoryGirl.build(:authentication, :resource => x)]
    end
  end

  factory :host_vmware_esx_with_authentication, :parent => :host_vmware_esx do
    after(:create) do |x|
      x.authentications = [FactoryGirl.build(:authentication, :resource => x)]
    end
  end

  # Factories for perf_capture_timer and perf_capture_gap testing
  factory :host_target_vmware, :parent => :host do
    after(:create) do |x|
      x.perf_capture_enabled = toggle_on_name_seq(x)
      2.times { x.vms << FactoryGirl.create(:vm_target_vmware, :ext_management_system => x.ext_management_system) }
    end
  end

  factory :host_with_ipmi, :parent => :host do
    ipmi_address "127.0.0.1"
    mac_address  "aa:bb:cc:dd:ee:ff"
    after(:create) do |x|
      x.authentications = [FactoryGirl.build(:authentication_ipmi, :resource => x)]
    end
  end

  factory :host_with_no_ipmi, :parent => :host do
    ipmi_address "127.0.0.1"
    mac_address  "aa:bb:cc:dd:ee:ff"
    after(:create) do |x|
      x.authentications = [FactoryGirl.build(:authentication, :resource => x)]
    end
  end

  # Type specific subclasses
  factory :host_vmware, :parent => :host, :class => "ManageIQ::Providers::Vmware::InfraManager::Host" do
    vmm_vendor "vmware"
  end

  factory :host_vmware_esx, :parent => :host_vmware, :class => "ManageIQ::Providers::Vmware::InfraManager::HostEsx" do
  end

  factory :host_redhat, :parent => :host, :class => "ManageIQ::Providers::Redhat::InfraManager::Host" do
    sequence(:ems_ref) { |n| "host-#{seq_padded_for_sorting(n)}" }
    vmm_vendor "redhat"
  end

  factory :host_openstack_infra, :parent => :host, :class => "ManageIQ::Providers::Openstack::InfraManager::Host" do
    vmm_vendor  ""
    ems_ref     "openstack-perf-host"
    ems_ref_obj "openstack-perf-host-nova-instance"
  end

  factory :host_microsoft, :parent => :host, :class => "ManageIQ::Providers::Microsoft::InfraManager::Host" do
    vmm_vendor  "microsoft"
    vmm_product "Hyper-V"
  end

  factory :node_kubernetes, :parent => :node, :class => "ContainerNodeKubernetes" do
    vmm_vendor "kubernetes"
  end

  factory :host_with_default_resource_pool, :parent => :host do
    after(:create) { |h| h.add_child(FactoryGirl.create(:default_resource_pool)) }
  end<commit_msg>vmm_vendor is already set<commit_after>FactoryGirl.define do
  factory :host do
    sequence(:name)     { |n| "host_#{seq_padded_for_sorting(n)}" }
    sequence(:hostname) { |n| "host_#{seq_padded_for_sorting(n)}" }
    vmm_vendor          "vmware"
    ipaddress           "127.0.0.1"
    user_assigned_os    "linux_generic"
    power_state         "on"
  end

  factory :host_with_ref, :parent => :host do
    sequence(:ems_ref)     { |n| "host-#{seq_padded_for_sorting(n)}" }
    sequence(:ems_ref_obj) { |n| VimString.new("host-#{seq_padded_for_sorting(n)}", "HostSystem", "ManagedObjectReference") }
  end

  factory :host_with_authentication, :parent => :host do
    after(:create) do |x|
      x.authentications = [FactoryGirl.build(:authentication, :resource => x)]
    end
  end

  factory :host_vmware_esx_with_authentication, :parent => :host_vmware_esx do
    after(:create) do |x|
      x.authentications = [FactoryGirl.build(:authentication, :resource => x)]
    end
  end

  # Factories for perf_capture_timer and perf_capture_gap testing
  factory :host_target_vmware, :parent => :host do
    after(:create) do |x|
      x.perf_capture_enabled = toggle_on_name_seq(x)
      2.times { x.vms << FactoryGirl.create(:vm_target_vmware, :ext_management_system => x.ext_management_system) }
    end
  end

  factory :host_with_ipmi, :parent => :host do
    ipmi_address "127.0.0.1"
    mac_address  "aa:bb:cc:dd:ee:ff"
    after(:create) do |x|
      x.authentications = [FactoryGirl.build(:authentication_ipmi, :resource => x)]
    end
  end

  factory :host_with_no_ipmi, :parent => :host do
    ipmi_address "127.0.0.1"
    mac_address  "aa:bb:cc:dd:ee:ff"
    after(:create) do |x|
      x.authentications = [FactoryGirl.build(:authentication, :resource => x)]
    end
  end

  # Type specific subclasses
  factory(:host_vmware,     :parent => :host,        :class => "ManageIQ::Providers::Vmware::InfraManager::Host")
  factory :host_vmware_esx, :parent => :host_vmware, :class => "ManageIQ::Providers::Vmware::InfraManager::HostEsx" do
  end

  factory :host_redhat, :parent => :host, :class => "ManageIQ::Providers::Redhat::InfraManager::Host" do
    sequence(:ems_ref) { |n| "host-#{seq_padded_for_sorting(n)}" }
    vmm_vendor "redhat"
  end

  factory :host_openstack_infra, :parent => :host, :class => "ManageIQ::Providers::Openstack::InfraManager::Host" do
    vmm_vendor  ""
    ems_ref     "openstack-perf-host"
    ems_ref_obj "openstack-perf-host-nova-instance"
  end

  factory :host_microsoft, :parent => :host, :class => "ManageIQ::Providers::Microsoft::InfraManager::Host" do
    vmm_vendor  "microsoft"
    vmm_product "Hyper-V"
  end

  factory :node_kubernetes, :parent => :node, :class => "ContainerNodeKubernetes" do
    vmm_vendor "kubernetes"
  end

  factory :host_with_default_resource_pool, :parent => :host do
    after(:create) { |h| h.add_child(FactoryGirl.create(:default_resource_pool)) }
  end
{'fraction_non_alphanumeric': 0.13834126444595513, 'fraction_numerical': 0.00645819170632223, 'mean_word_length': 4.203359858532273, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, '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': '1513538', 'n_tokens_mistral': 2176, 'n_tokens_neox': 2098, 'n_words': 395}