<commit_before>require 'rubygems'
require 'net/ssh'

SSH_USER = 'ubuntu'

def connect_to_host(host, &block)
  puts "Connecting to #{host}"
  session = Net::SSH.start(host, SSH_USER) do |ssh|
    channel = ssh.open_channel do |ch|
      yield ch
    end
    channel.wait
  end
end

def stream_log(host, logPath, &block)
  connect_to_host(host) do |ch|
    ch.exec "tail -n 200 -f #{logPath}" do |ch, success|
      yield(ch, success)
    end
  end
end<commit_msg>added the message to console, which had been removed by mistake<commit_after>require 'rubygems'
require 'net/ssh'

SSH_USER = 'ubuntu'

def connect_to_host(host, &block)
  puts "Connecting to #{host}"
  session = Net::SSH.start(host, SSH_USER) do |ssh|
    channel = ssh.open_channel do |ch|
      yield ch
    end
    channel.wait
  end
end

def stream_log(host, logPath, &block)
  connect_to_host(host) do |ch|
    puts "Tailing log file: #{logPath}"
    ch.exec "tail -n 200 -f #{logPath}" do |ch, success|
      yield(ch, success)
    end
  end
end
{'fraction_non_alphanumeric': 0.11932938856015779, 'fraction_numerical': 0.005917159763313609, 'mean_word_length': 3.4911504424778763, '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': '1729448', 'n_tokens_mistral': 389, 'n_tokens_neox': 373, 'n_words': 112}