<commit_before>module VagrantPlugins
  module DigitalOcean
    class Config < Vagrant.plugin('2', :config)
      attr_accessor :token
      attr_accessor :image
      attr_accessor :image_name
      attr_accessor :region
      attr_accessor :size
      attr_accessor :private_networking
      attr_accessor :ipv6
      attr_accessor :backups_enabled
      attr_accessor :ca_path
      attr_accessor :ssh_key_name
      attr_accessor :setup
      attr_accessor :user_data
      attr_accessor :root_username

      alias_method :setup?, :setup

      def initialize
        @token              = UNSET_VALUE
        @image              = UNSET_VALUE
        @image_name         = UNSET_VALUE
        @region             = UNSET_VALUE
        @size               = UNSET_VALUE
        @private_networking = UNSET_VALUE
        @ipv6               = UNSET_VALUE
        @backups_enable     = UNSET_VALUE
        @ca_path            = UNSET_VALUE
        @ssh_key_name       = UNSET_VALUE
        @setup              = UNSET_VALUE
        @user_data          = UNSET_VALUE
        @root_username      = UNSET_VALUE
      end

      def finalize!
        @token              = ENV['DO_TOKEN'] if @token == UNSET_VALUE
        @image              = 'ubuntu-14-04-x64' if @image == UNSET_VALUE
        @image_name         = nil if @image_name == UNSET_VALUE
        @region             = 'nyc2' if @region == UNSET_VALUE
        @size               = '512mb' if @size == UNSET_VALUE
        @private_networking = false if @private_networking == UNSET_VALUE
        @ipv6               = false if @ipv6 == UNSET_VALUE
        @backups_enabled    = false if @backups_enabled == UNSET_VALUE
        @ca_path            = nil if @ca_path == UNSET_VALUE
        @ssh_key_name       = 'Vagrant' if @ssh_key_name == UNSET_VALUE
        @setup              = true if @setup == UNSET_VALUE
        @user_data          = nil if @user_data == UNSET_VALUE
        @root_username      = 'root' if @root_username == UNSET_VALUE
      end

      def validate(machine)
        errors = []
        errors << I18n.t('vagrant_digital_ocean.config.token') if !@token

        key = machine.config.ssh.private_key_path
        key = key[0] if key.is_a?(Array)
        if !key
          errors << I18n.t('vagrant_digital_ocean.config.private_key')
        elsif !File.file?(File.expand_path("#{key}.pub", machine.env.root_path))
          errors << I18n.t('vagrant_digital_ocean.config.public_key', {
            :key => "#{key}.pub"
          })
        end

        { 'Digital Ocean Provider' => errors }
      end
    end
  end<commit_msg>use nyc3 since it has ubuntu, centos, and coreos<commit_after>module VagrantPlugins
  module DigitalOcean
    class Config < Vagrant.plugin('2', :config)
      attr_accessor :token
      attr_accessor :image
      attr_accessor :image_name
      attr_accessor :region
      attr_accessor :size
      attr_accessor :private_networking
      attr_accessor :ipv6
      attr_accessor :backups_enabled
      attr_accessor :ca_path
      attr_accessor :ssh_key_name
      attr_accessor :setup
      attr_accessor :user_data
      attr_accessor :root_username

      alias_method :setup?, :setup

      def initialize
        @token              = UNSET_VALUE
        @image              = UNSET_VALUE
        @image_name         = UNSET_VALUE
        @region             = UNSET_VALUE
        @size               = UNSET_VALUE
        @private_networking = UNSET_VALUE
        @ipv6               = UNSET_VALUE
        @backups_enable     = UNSET_VALUE
        @ca_path            = UNSET_VALUE
        @ssh_key_name       = UNSET_VALUE
        @setup              = UNSET_VALUE
        @user_data          = UNSET_VALUE
        @root_username      = UNSET_VALUE
      end

      def finalize!
        @token              = ENV['DO_TOKEN'] if @token == UNSET_VALUE
        @image              = 'ubuntu-14-04-x64' if @image == UNSET_VALUE
        @image_name         = nil if @image_name == UNSET_VALUE
        @region             = 'nyc3' if @region == UNSET_VALUE
        @size               = '512mb' if @size == UNSET_VALUE
        @private_networking = false if @private_networking == UNSET_VALUE
        @ipv6               = false if @ipv6 == UNSET_VALUE
        @backups_enabled    = false if @backups_enabled == UNSET_VALUE
        @ca_path            = nil if @ca_path == UNSET_VALUE
        @ssh_key_name       = 'Vagrant' if @ssh_key_name == UNSET_VALUE
        @setup              = true if @setup == UNSET_VALUE
        @user_data          = nil if @user_data == UNSET_VALUE
        @root_username      = 'root' if @root_username == UNSET_VALUE
      end

      def validate(machine)
        errors = []
        errors << I18n.t('vagrant_digital_ocean.config.token') if !@token

        key = machine.config.ssh.private_key_path
        key = key[0] if key.is_a?(Array)
        if !key
          errors << I18n.t('vagrant_digital_ocean.config.private_key')
        elsif !File.file?(File.expand_path("#{key}.pub", machine.env.root_path))
          errors << I18n.t('vagrant_digital_ocean.config.public_key', {
            :key => "#{key}.pub"
          })
        end

        { 'Digital Ocean Provider' => errors }
      end
    end
  end
{'fraction_non_alphanumeric': 0.08328579577866514, 'fraction_numerical': 0.008556759840273816, 'mean_word_length': 1.7963849016480595, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 7, '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': '228221', 'n_tokens_mistral': 1639, 'n_tokens_neox': 1650, 'n_words': 339}