<commit_before>require 'thread'

require 'concurrent/global_thread_pool'

module Concurrent

  IllegalMethodCallError = Class.new(StandardError)

  class Defer

    def initialize(opts = {}, &block)
      operation = opts[:op] || opts[:operation]
      callback = opts[:cback] || opts[:callback]
      errorback = opts[:eback] || opts[:error] || opts[:errorback]

      raise ArgumentError.new('no operation given') if operation.nil? && ! block_given?
      raise ArgumentError.new('two operations given') if ! operation.nil? && block_given?

      @operation = operation || block
      @callback = callback
      @errorback = errorback

      if operation.nil?
        @running = false
      else
        self.go
      end
    end<commit_msg>Updated Defer#initialize to use named arguments instead of regular paramaters<commit_after>require 'thread'

require 'concurrent/global_thread_pool'

module Concurrent

  IllegalMethodCallError = Class.new(StandardError)

  class Defer

    def initialize(opts = {}, &block)
      operation = opts[:op] || opts[:operation]
      @callback = opts[:cback] || opts[:callback]
      @errorback = opts[:eback] || opts[:error] || opts[:errorback]

      raise ArgumentError.new('no operation given') if operation.nil? && ! block_given?
      raise ArgumentError.new('two operations given') if ! operation.nil? && block_given?

      @operation = operation || block

      if operation.nil?
        @running = false
      else
        self.go
      end
    end
{'fraction_non_alphanumeric': 0.1143048128342246, 'fraction_numerical': 0.0, 'mean_word_length': 3.252840909090909, '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': '1271617', 'n_tokens_mistral': 422, 'n_tokens_neox': 407, 'n_words': 108}