<commit_before>class ManageIQ::Providers::Amazon::CloudManager::AuthKeyPair < ManageIQ::Providers::CloudManager::AuthKeyPair
  def self.raw_create_key_pair(ext_management_system, create_options)
    ec2 = ext_management_system.connect
    kp = ec2.create_key_pair(create_options)
    ost = OpenStruct.new
    ost.name = ost.key_name = kp.name
    ost.fingerprint = kp.key_fingerprint
    ost.private_key = kp.key_material
    ost
  rescue => err
    _log.error "keypair=[#{name}], error: #{err}"
    raise MiqException::Error, err.to_s, err.backtrace
  end

  def self.validate_create_key_pair(ext_management_system, _options = {})
    if ext_management_system
      {:available => true, :message => nil}
    else
      {:available => false,
       :message   => _("The Keypair is not connected to an active %{table}") %
         {:table => ui_lookup(:table => "ext_management_system")}}
    end
  end

  def raw_delete_key_pair
    ec2 = resource.connect
    kp = ec2.key_pair(name)
    kp.delete
  rescue => err
    _log.error "keypair=[#{name}], error: #{err}"
    raise MiqException::Error, err.to_s, err.backtrace
  end

  def validate_delete_key_pair
    {:available => true, :message => nil}<commit_msg>Replace OpenStruct with Struct<commit_after>class ManageIQ::Providers::Amazon::CloudManager::AuthKeyPair < ManageIQ::Providers::CloudManager::AuthKeyPair
  def self.raw_create_key_pair(ext_management_system, create_options)
    ec2 = ext_management_system.connect
    kp = ec2.create_key_pair(create_options)
    AwsKeyPair = Struct.new(:name, :key_name, :fingerprint, :private_key)
    AwsKeyPair.new(kp.name, kp.name, kp.key_fingerprint, kp.key_material)
  rescue => err
    _log.error "keypair=[#{name}], error: #{err}"
    raise MiqException::Error, err.to_s, err.backtrace
  end

  def self.validate_create_key_pair(ext_management_system, _options = {})
    if ext_management_system
      {:available => true, :message => nil}
    else
      {:available => false,
       :message   => _("The Keypair is not connected to an active %{table}") %
         {:table => ui_lookup(:table => "ext_management_system")}}
    end
  end

  def raw_delete_key_pair
    ec2 = resource.connect
    kp = ec2.key_pair(name)
    kp.delete
  rescue => err
    _log.error "keypair=[#{name}], error: #{err}"
    raise MiqException::Error, err.to_s, err.backtrace
  end

  def validate_delete_key_pair
    {:available => true, :message => nil}
{'fraction_non_alphanumeric': 0.12320328542094455, 'fraction_numerical': 0.0032854209445585215, 'mean_word_length': 4.0644490644490645, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '138942', 'n_tokens_mistral': 837, 'n_tokens_neox': 816, 'n_words': 165}