<commit_before>require 'drb'
require 'foodtaster/version'

module Foodtaster
  class Client
    MAX_ATTEMPTS = 20

    def self.connect(drb_port, server_process = nil)
      attempt_index = 1
      begin
        sleep 0.2
        client = Foodtaster::Client.new(drb_port)
      rescue DRb::DRbConnError => e
        Foodtaster.logger.debug "DRb connection failed (attempt #{attempt_index}/#{MAX_ATTEMPTS}): #{e.message}"
        attempt_index += 1
        retry if attempt_index <= MAX_ATTEMPTS && (server_process.nil? || server_process.alive?)
      end

      if client
        Foodtaster.logger.debug "DRb connection established"
      else
        Foodtaster.logger.debug "Can't connect to Foodtaster DRb Server"
      end

      client
    end

    [:vm_defined?, :prepare_vm, :rollback_vm,
      :run_chef_on_vm, :execute_command_on_vm,<commit_msg>remove obsolete prepare_vm delegate from Client class<commit_after>require 'drb'
require 'foodtaster/version'

module Foodtaster
  class Client
    MAX_ATTEMPTS = 20

    def self.connect(drb_port, server_process = nil)
      attempt_index = 1
      begin
        sleep 0.2
        client = Foodtaster::Client.new(drb_port)
      rescue DRb::DRbConnError => e
        Foodtaster.logger.debug "DRb connection failed (attempt #{attempt_index}/#{MAX_ATTEMPTS}): #{e.message}"
        attempt_index += 1
        retry if attempt_index <= MAX_ATTEMPTS && (server_process.nil? || server_process.alive?)
      end

      if client
        Foodtaster.logger.debug "DRb connection established"
      else
        Foodtaster.logger.debug "Can't connect to Foodtaster DRb Server"
      end

      client
    end

    [:vm_defined?, :rollback_vm,
      :run_chef_on_vm, :execute_command_on_vm,
{'fraction_non_alphanumeric': 0.08991354466858789, 'fraction_numerical': 0.0069164265129683, 'mean_word_length': 2.9454545454545453, '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': '2098493', 'n_tokens_mistral': 567, 'n_tokens_neox': 545, 'n_words': 128}