<commit_before>module Vcloud
  module Launcher
    class VmOrchestrator
      def initialize fog_vm, vapp
        vm_id = fog_vm[:href].split('/').last
        @vm = Core::Vm.new(vm_id, vapp)
      end

      def customize(vm_config)
        @vm.update_name(@vm.vapp_name)
        @vm.configure_network_interfaces vm_config[:network_connections]
        @vm.update_storage_profile(vm_config[:storage_profile]) if vm_config[:storage_profile]
        if hardware_config = vm_config[:hardware_config]
          @vm.update_cpu_count(hardware_config[:cpu])
          @vm.update_memory_size_in_mb(hardware_config[:memory])
        end
        @vm.add_extra_disks(vm_config[:extra_disks])
        @vm.update_metadata(vm_config[:metadata])
        @vm.configure_guest_customization_section(
            @vm.vapp_name,
            vm_config[:bootstrap],
            vm_config[:extra_disks]
        )
      end

      def self.customize_schema
        {
          type: 'hash',
          required: false,
          allowed_empty: false,
          internals: {
            network_connections: {
              type: 'array',
              required: false,
              each_element_is: {
                type: 'hash',
                internals: {
                  name: { type: 'string', required: true },
                  ip_address: { type: 'ip_address', required: false },<commit_msg>Replace assignment in condition for VM<commit_after>module Vcloud
  module Launcher
    class VmOrchestrator
      def initialize fog_vm, vapp
        vm_id = fog_vm[:href].split('/').last
        @vm = Core::Vm.new(vm_id, vapp)
      end

      def customize(vm_config)
        @vm.update_name(@vm.vapp_name)
        @vm.configure_network_interfaces vm_config[:network_connections]
        @vm.update_storage_profile(vm_config[:storage_profile]) if vm_config[:storage_profile]
        if vm_config[:hardware_config]
          @vm.update_cpu_count(vm_config[:hardware_config][:cpu])
          @vm.update_memory_size_in_mb(vm_config[:hardware_config][:memory])
        end
        @vm.add_extra_disks(vm_config[:extra_disks])
        @vm.update_metadata(vm_config[:metadata])
        @vm.configure_guest_customization_section(
            @vm.vapp_name,
            vm_config[:bootstrap],
            vm_config[:extra_disks]
        )
      end

      def self.customize_schema
        {
          type: 'hash',
          required: false,
          allowed_empty: false,
          internals: {
            network_connections: {
              type: 'array',
              required: false,
              each_element_is: {
                type: 'hash',
                internals: {
                  name: { type: 'string', required: true },
                  ip_address: { type: 'ip_address', required: false },
{'fraction_non_alphanumeric': 0.1007529580494801, 'fraction_numerical': 0.0, 'mean_word_length': 2.1278026905829597, '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': '5145442', 'n_tokens_mistral': 836, 'n_tokens_neox': 817, 'n_words': 134}