<commit_before>module Brightbox
  class Server < Api

    def self.create(options)
      new(conn.servers.create(options))
    end

    def server_type
      @server_type ||= Type.new(flavor_id)
    end

    def image
      @image ||= Image.new(image_id)
    end

    def attributes
      a = fog_model.attributes
      a[:image] = image
      a[:description] = description.to_s.strip
      a[:created_at] = created_at
      a[:created_on] = fog_model.created_at.strftime("%Y-%m-%d")
      a[:type] = server_type
      a[:zone] = Zone.new(zone_id)
      a[:hostname] = hostname
      a[:public_hostname] = public_hostname unless cloud_ips.empty?
      a
    end

    def to_row
      o = attributes
      o[:cloud_ips] = cloud_ips.collect { |i| i['public_ip'] }
      o[:ips] = interfaces.collect { |i| i['ipv4_address'] }.join(', ')
      o
    end

    def deleted?
      fog_model.status == "deleted"
    end

    def destroy
      fog_model.destroy
    rescue Excon::Errors::Conflict => e
      raise Conflict, "Cannot delete server #{id}"
    end

    def self.get(id)
      conn.servers.get id
    end

    def self.all
      conn.servers
    end

    def self.default_field_order
      [:id, :status, :type, :zone, :created_on, :image_id, :cloud_ips, :name]
    end

    def hostname
      "#{id}.gb1.eu.brightbox.com"
    end

    def public_hostname
      "public.#{hostname}"
    end
  end<commit_msg>remove eu from hostname<commit_after>module Brightbox
  class Server < Api

    def self.create(options)
      new(conn.servers.create(options))
    end

    def server_type
      @server_type ||= Type.new(flavor_id)
    end

    def image
      @image ||= Image.new(image_id)
    end

    def attributes
      a = fog_model.attributes
      a[:image] = image
      a[:description] = description.to_s.strip
      a[:created_at] = created_at
      a[:created_on] = fog_model.created_at.strftime("%Y-%m-%d")
      a[:type] = server_type
      a[:zone] = Zone.new(zone_id)
      a[:hostname] = hostname
      a[:public_hostname] = public_hostname unless cloud_ips.empty?
      a
    end

    def to_row
      o = attributes
      o[:cloud_ips] = cloud_ips.collect { |i| i['public_ip'] }
      o[:ips] = interfaces.collect { |i| i['ipv4_address'] }.join(', ')
      o
    end

    def deleted?
      fog_model.status == "deleted"
    end

    def destroy
      fog_model.destroy
    rescue Excon::Errors::Conflict => e
      raise Conflict, "Cannot delete server #{id}"
    end

    def self.get(id)
      conn.servers.get id
    end

    def self.all
      conn.servers
    end

    def self.default_field_order
      [:id, :status, :type, :zone, :created_on, :image_id, :cloud_ips, :name]
    end

    def hostname
      "#{id}.gb1.brightbox.com"
    end

    def public_hostname
      "public.#{hostname}"
    end
  end
{'fraction_non_alphanumeric': 0.12053729232944503, 'fraction_numerical': 0.0014139271827500884, 'mean_word_length': 2.3491124260355027, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3790319', 'n_tokens_mistral': 975, 'n_tokens_neox': 970, 'n_words': 214}