<commit_before>require 'ostruct'
require 'fog/core/timeout'
require 'fog/core/wait_for'
require 'etc'

module Blimpy::Boxes
  # Fake box type for physical computer accessible through SSH
  class Existing < Blimpy::Box
    def self.fog_server_for_instance(id, blimpdata)
      ExistingServer.new(id)
    end

    def initialize(server=nil)
      super(server)
      @username = Etc.getlogin
    end

    def validate!
      if @name.nil?
        raise Blimpy::BoxValidationError, "Don't know which box to log into --- the host property is not set."
      end
    end

    def wait_for_state(until_state, &block)
      # this magical box type becomes any state instantly
    end

    private

    def create_host
      ExistingServer.new(@name)
    end
  end

  class ExistingServer
    def initialize(name)
      @name = name
    end
    def dns_name
      @name
    end
    def private_dns_name
      @name
    end
    def id
      @name
    end

    def wait_for(timeout=Fog.timeout, interval=1, &block)
      Fog.wait_for(timeout, interval, &block)
    end

    # no-ops
    def stop
    end
    def start
    end
    def destroy
    end
  end
end
<commit_msg>differentiating host and name as host can contain dots and other possibly nasty characters<commit_after>require 'ostruct'
require 'fog/core/timeout'
require 'fog/core/wait_for'
require 'etc'

module Blimpy::Boxes
    # Fake box type for physical computer accessible through SSH
  class Existing < Blimpy::Box
    attr_accessor :host

    def self.fog_server_for_instance(id, blimpdata)
      ExistingServer.new(id,blimpdata[:host])
    end

    def initialize(server=nil)
      super(server)
      @username = Etc.getlogin
    end

    def validate!
      if @host.nil?
        raise Blimpy::BoxValidationError, "Don't know which box to log into --- the host property is not set."
      end
    end

    def wait_for_state(until_state, &block)
      # this magical box type becomes any state instantly
    end

    private

    def create_host
      ExistingServer.new(@name,@host)
    end
  end

  class ExistingServer
    def initialize(name,host)
      @name = name
      @host = host
    end
    def dns_name
      @host
    end
    def private_dns_name
      @host
    end
    def id
      @name
    end

    def wait_for(timeout=Fog.timeout, interval=1, &block)
      Fog.wait_for(timeout, interval, &block)
    end

    # no-ops
    def stop
    end
    def start
    end
    def destroy
    end
  end
end

{'fraction_non_alphanumeric': 0.0703030303030303, 'fraction_numerical': 0.0008080808080808081, 'mean_word_length': 2.4293628808864267, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2985307', 'n_tokens_mistral': 808, 'n_tokens_neox': 783, 'n_words': 239}