<commit_before>module Sidekiq
  class Batch
    module Callback
      class Worker
        include Sidekiq::Worker

        def perform(clazz, event, opts, bid)
          clazz, method = clazz.split("#") if (clazz.class == String && clazz.include?("#"))
          method = "on_#{event}" if method.nil?
          clazz.constantize.new.send(method, Sidekiq::Batch::Status.new(bid), opts) rescue nil
        end
      end

      class << self
        def call_if_needed(event, bid)
          needed = Sidekiq.redis do |r|
            r.multi do
              r.hget("BID-#{bid}", event)
              r.hset("BID-#{bid}", event, true)
            end
          end<commit_msg>Re-added a little evaluation just to be safe<commit_after>module Sidekiq
  class Batch
    module Callback
      class Worker
        include Sidekiq::Worker

        def perform(clazz, event, opts, bid)
          return unless %w(success complete).include?(event)
          clazz, method = clazz.split("#") if (clazz.class == String && clazz.include?("#"))
          method = "on_#{event}" if method.nil?
          clazz.constantize.new.send(method, Sidekiq::Batch::Status.new(bid), opts) rescue nil
        end
      end

      class << self
        def call_if_needed(event, bid)
          needed = Sidekiq.redis do |r|
            r.multi do
              r.hget("BID-#{bid}", event)
              r.hset("BID-#{bid}", event, true)
            end
          end
{'fraction_non_alphanumeric': 0.12378303198887343, 'fraction_numerical': 0.0, 'mean_word_length': 1.9731404958677685, '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': '750309', 'n_tokens_mistral': 440, 'n_tokens_neox': 440, 'n_words': 112}