<commit_before>require 'concurrent/executor/thread_pool_executor'

module Expeditor
  class Service
    attr_reader :executor
    attr_accessor :fallback_enabled

    def initialize(opts = {})
      @executor = opts.fetch(:executor) { Concurrent::ThreadPoolExecutor.new }
      @threshold = opts.fetch(:threshold, 0.5) # is 0.5 ok?
      @non_break_count = opts.fetch(:non_break_count, 20)
      @sleep = opts.fetch(:sleep, 1)
      @bucket_opts = {
        size: 10,
        per: opts.fetch(:period, 10).to_f / 10
      }
      reset_status!
      @fallback_enabled = true<commit_msg>0.5 seems OK for default threshold value<commit_after>require 'concurrent/executor/thread_pool_executor'

module Expeditor
  class Service
    attr_reader :executor
    attr_accessor :fallback_enabled

    def initialize(opts = {})
      @executor = opts.fetch(:executor) { Concurrent::ThreadPoolExecutor.new }
      @threshold = opts.fetch(:threshold, 0.5)
      @non_break_count = opts.fetch(:non_break_count, 20)
      @sleep = opts.fetch(:sleep, 1)
      @bucket_opts = {
        size: 10,
        per: opts.fetch(:period, 10).to_f / 10
      }
      reset_status!
      @fallback_enabled = true
{'fraction_non_alphanumeric': 0.11148648648648649, 'fraction_numerical': 0.02195945945945946, 'mean_word_length': 3.1289198606271778, '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': '4789510', 'n_tokens_mistral': 399, 'n_tokens_neox': 375, 'n_words': 76}