<commit_before>module ConveyorBelt

  class InMemoryContract < Contract

    attr_reader :target_ids_to_execute
    attr_reader :target_ids_to_ignore
    attr_reader :mass_operation

    def initialize
      @target_ids_to_execute = []
      @target_ids_to_ignore  = []
    end

    def start_mass_operation_definition mass_operation
      @mass_operation = mass_operation
    end

    def mark_for_ignoring target_id
      @target_ids_to_ignore << target_id
    end

    def mark_for_execution target_id
      @target_ids_to_execute << target_id
    end

    def stop_mass_operation_definition mass_operation
      target_ids_to_execute.each do |target_id|
        operation = mass_operation.operations.select { |o| o.target_id == target_id }.first
        operation.execute
      end
      target_ids_to_ignore.each do |target_id|
        operation = mass_operation.operations.select { |o| o.target_id == target_id }.first
        operation.ignore
      end
    end

    def execute target_id
      perform find(target_id)
      mass_operation.succeeded! target_id
    end

    def ignore target_id
      mass_operation.ignored! target_id<commit_msg>No need for the @ here.<commit_after>module ConveyorBelt

  class InMemoryContract < Contract

    attr_reader :target_ids_to_execute
    attr_reader :target_ids_to_ignore
    attr_reader :mass_operation

    def initialize
      @target_ids_to_execute = []
      @target_ids_to_ignore  = []
    end

    def start_mass_operation_definition mass_operation
      @mass_operation = mass_operation
    end

    def mark_for_ignoring target_id
      target_ids_to_ignore << target_id
    end

    def mark_for_execution target_id
      target_ids_to_execute << target_id
    end

    def stop_mass_operation_definition mass_operation
      target_ids_to_execute.each do |target_id|
        operation = mass_operation.operations.select { |o| o.target_id == target_id }.first
        operation.execute
      end
      target_ids_to_ignore.each do |target_id|
        operation = mass_operation.operations.select { |o| o.target_id == target_id }.first
        operation.ignore
      end
    end

    def execute target_id
      perform find(target_id)
      mass_operation.succeeded! target_id
    end

    def ignore target_id
      mass_operation.ignored! target_id
{'fraction_non_alphanumeric': 0.05103806228373702, 'fraction_numerical': 0.0, 'mean_word_length': 3.0793650793650795, 'pattern_counts': {'":': 0, '<': 13, '<?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': '6599340', 'n_tokens_mistral': 712, 'n_tokens_neox': 687, 'n_words': 149}