<commit_before>require 'concurrent/agent'
require 'concurrent/defer'
require 'concurrent/future'
require 'concurrent/promise'

module Kernel

  ## agent

  def agent(initial, timeout = Concurrent::Agent::TIMEOUT)
    return Concurrent::Agent.new(initial, timeout)
  end
  module_function :agent

  def post(object, &block)
    if object.respond_to?(:post)
      return object.post(&block)
    else
      raise ArgumentError.new('object does not support #post')
    end
  end
  module_function :post

  ## defer

  def defer(*args, &block)
    return Concurrent::Defer.new(*args, &block)
  end
  module_function :defer

  ## future

  def future(*args, &block)
    return Concurrent::Future.new(*args, &block)
  end
  module_function :future

  ## obligation

  def deref(object, timeout = nil)
    if object.respond_to?(:deref)
      return object.deref(timeout)
    elsif object.respond_to?(:value)
      return object.value(timeout)
    else
      raise ArgumentError.new('object does not support #deref')
    end
  end
  module_function :deref

  def pending?(object)
    if object.respond_to?(:pending?)
      return object.pending?
    else
      raise ArgumentError.new('object does not support #pending?')
    end
  end
  module_function :pending?

  def fulfilled?(object)
    if object.respond_to?(:fulfilled?)
      return object.fulfilled?
    elsif object.respond_to?(:realized?)
      return object.realized?<commit_msg>Function module now uses *args on most calls.<commit_after>require 'concurrent/agent'
require 'concurrent/defer'
require 'concurrent/future'
require 'concurrent/promise'

module Kernel

  ## agent

  def agent(*args, &block)
    return Concurrent::Agent.new(*args, &block)
  end
  module_function :agent

  def post(object, *args, &block)
    if object.respond_to?(:post)
      return object.post(*args, &block)
    else
      raise ArgumentError.new('object does not support #post')
    end
  end
  module_function :post

  ## defer

  def defer(*args, &block)
    return Concurrent::Defer.new(*args, &block)
  end
  module_function :defer

  ## future

  def future(*args, &block)
    return Concurrent::Future.new(*args, &block)
  end
  module_function :future

  ## obligation

  def deref(object, *args, &block)
    if object.respond_to?(:deref)
      return object.deref(*args, &block)
    elsif object.respond_to?(:value)
      return object.value(*args, &block)
    else
      raise ArgumentError.new('object does not support #deref')
    end
  end
  module_function :deref

  def pending?(object)
    if object.respond_to?(:pending?)
      return object.pending?
    else
      raise ArgumentError.new('object does not support #pending?')
    end
  end
  module_function :pending?

  def fulfilled?(object)
    if object.respond_to?(:fulfilled?)
      return object.fulfilled?
    elsif object.respond_to?(:realized?)
      return object.realized?
{'fraction_non_alphanumeric': 0.10972654897888542, 'fraction_numerical': 0.0, 'mean_word_length': 3.6019108280254777, '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': '7431683', 'n_tokens_mistral': 912, 'n_tokens_neox': 880, 'n_words': 229}