<commit_before>module Boson
  module PipeRunner
    PIPE = '+'

    def parse_args(args)
      @all_args = Util.split_array_by(args, PIPE)
      args = @all_args[0]
      super(args).tap do |result|
        @all_args[0] = [result[0]] + result[2]
      end
    end

    def execute_command(command, args)
      @all_args.inject(nil) do |acc, (cmd,*args)|
        args = translate_args(args, acc)
        super(cmd, args)
      end
    end

    def translate_args(args, piped)
      args.unshift piped if piped
      args
    end

    # Commands to executed, in order given by user<commit_msg>add forgotten dependency for pipe runner<commit_after>module Boson
  module PipeRunner
    PIPE = '+'

    # Splits array into array of arrays with given element
    def self.split_array_by(arr, divider)
      arr.inject([[]]) {|results, element|
        (divider == element) ? (results << []) : (results.last << element)
        results
      }
    end

    def parse_args(args)
      @all_args = PipeRunner.split_array_by(args, PIPE)
      args = @all_args[0]
      super(args).tap do |result|
        @all_args[0] = [result[0]] + result[2]
      end
    end

    def execute_command(command, args)
      @all_args.inject(nil) do |acc, (cmd,*args)|
        args = translate_args(args, acc)
        super(cmd, args)
      end
    end

    def translate_args(args, piped)
      args.unshift piped if piped
      args
    end

    # Commands to executed, in order given by user
{'fraction_non_alphanumeric': 0.10770279481935924, 'fraction_numerical': 0.0054533060668029995, 'mean_word_length': 2.4622641509433962, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7024364', 'n_tokens_mistral': 494, 'n_tokens_neox': 481, 'n_words': 128}