<commit_before>require 'net/ssh'
require 'shellwords'
require 'travis/worker/utils/buffer'
require 'travis/support/logging'

module Travis
  module Worker
    module Ssh
      # Encapsulates an SSH connection to a remote host.
      class Session
        include Logging

        class NoOutputReceivedError < StandardError
          attr_reader :minutes
          def initialize(minutes)
            super("No output has been received in the last #{minutes} minutes, this potentially indicates a stalled build or something wrong with the build itself.\n\nThe build has been terminated")
          end
        end

        log_header { "#{name}:shell:session" }

        attr_reader :name, :config, :ssh_session

        # Initialize a shell Session
        #
        # config - A hash containing the timeouts, shell buffer time and ssh connection information
        # block - An optional block of commands to be excuted within the session. If
        #         a block is provided then the session will be started, block evaluated,
        #         and then the session will be closed.
        def initialize(name, config)
          @name = name
          @config = Hashr.new(config)
        end<commit_msg>add base64<commit_after>require 'net/ssh'
require 'shellwords'
require 'travis/worker/utils/buffer'
require 'travis/support/logging'
require 'base64'

module Travis
  module Worker
    module Ssh
      # Encapsulates an SSH connection to a remote host.
      class Session
        include Logging

        class NoOutputReceivedError < StandardError
          attr_reader :minutes
          def initialize(minutes)
            super("No output has been received in the last #{minutes} minutes, this potentially indicates a stalled build or something wrong with the build itself.\n\nThe build has been terminated")
          end
        end

        log_header { "#{name}:shell:session" }

        attr_reader :name, :config, :ssh_session

        # Initialize a shell Session
        #
        # config - A hash containing the timeouts, shell buffer time and ssh connection information
        # block - An optional block of commands to be excuted within the session. If
        #         a block is provided then the session will be started, block evaluated,
        #         and then the session will be closed.
        def initialize(name, config)
          @name = name
          @config = Hashr.new(config)
        end
{'fraction_non_alphanumeric': 0.05916187345932621, 'fraction_numerical': 0.0016433853738701725, 'mean_word_length': 2.3819444444444446, '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': '3723826', 'n_tokens_mistral': 615, 'n_tokens_neox': 586, 'n_words': 252}