<commit_before>require 'tty/command'

module SubmissionRunners
  class Base
    attr_reader :submission, :errors, :output

    def initialize(submission)
      @submission = submission
      @errors     = {}
      @output     = ""
    end

    def submission_dir
      submission.uploaded_files_dir
    end

    def problem_timeout
      submission.problem_timeout || 30.seconds
    end

    def run_command(command, **options)
      TTY::Command.new.run(command, **options)
    end

    def build_container
      "#{container_prefix}-build-#{container_suffix}"
    end

    def run_container
      "#{container_prefix}-run-#{container_suffix}"
    end

    def container_prefix
      self.class.name.demodulize.underscore<commit_msg>silenced TTY::Command output<commit_after>require 'tty/command'

module SubmissionRunners
  class Base
    attr_reader :submission, :errors, :output

    def initialize(submission)
      @submission = submission
      @errors     = {}
      @output     = ""
    end

    def submission_dir
      submission.uploaded_files_dir
    end

    def problem_timeout
      submission.problem_timeout || 30.seconds
    end

    def run_command(command, **options)
      TTY::Command.
        new(printer: :null).
        run(command, **options)
    end

    def build_container
      "#{container_prefix}-build-#{container_suffix}"
    end

    def run_container
      "#{container_prefix}-run-#{container_suffix}"
    end

    def container_prefix
      self.class.name.demodulize.underscore
{'fraction_non_alphanumeric': 0.09096901779828609, 'fraction_numerical': 0.0026367831245880024, 'mean_word_length': 2.7761194029850746, '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': '4714489', 'n_tokens_mistral': 463, 'n_tokens_neox': 448, 'n_words': 90}