<commit_before># require_relative 'factory_days/business_weekends'
require_relative 'holidays'

module ActiveSupport
  module CoreExtensions
    module Date
      module FactoryDays
        def check_manufacturers(*manufacturers)
          manufacturers.empty? ? manufacturers.push(:jewlr) : manufacturers
        end

        def factory_day?(*manufacturers)
          manufacturers = check_manufacturers(*manufacturers)
          return true \
            if (1..5).cover?(wday) && Holidays.on(self, *manufacturers).empty?
          business_weekends(*manufacturers).include?(self) ? true : false
        end

        def next_factory_day(*manufacturers, num_days:1)
          manufacturers = check_manufacturers(*manufacturers)
          day_count = 0
          next_day = self
          while day_count < num_days
            next_day += 1.days
            if next_day.factory_day(*manufacturers)?
              day_count += 1
            end
          end
          next_day
        end

        def prev_factory_day(*manufacturers, num_days:1)
          manufacturers = check_manufacturers(*manufacturers)
          day_count = 0
          prev_day = self
          while day_count < num_days
            prev_day -= 1.days
            if prev_day.factory_day(*manufacturers)?
              day_count += 1
            end
          end
          prev_day
        end

        def days_calculator(until_date, *manufacturers)
          holidays_count = Holidays.between(self, until_date, *manufacturers).size
          weekends_count = (self...until_date).count { |dt| business_weekends(*manufacturers).include?(dt) }<commit_msg>more bug fixes<commit_after># require_relative 'factory_days/business_weekends'
require_relative 'holidays'

module ActiveSupport
  module CoreExtensions
    module Date
      module FactoryDays
        def check_manufacturers(*manufacturers)
          manufacturers.empty? ? manufacturers.push(:jewlr) : manufacturers
        end

        def factory_day?(*manufacturers)
          manufacturers = check_manufacturers(*manufacturers)
          return true \
            if (1..5).cover?(wday) && Holidays.on(self, *manufacturers).empty?
          business_weekends(*manufacturers).include?(self) ? true : false
        end

        def next_factory_day(*manufacturers, num_days:1)
          manufacturers = check_manufacturers(*manufacturers)
          day_count = 0
          next_day = self
          while day_count < num_days
            next_day += 1.days
            if next_day.factory_day?(*manufacturers)
              day_count += 1
            end
          end
          next_day
        end

        def prev_factory_day(*manufacturers, num_days:1)
          manufacturers = check_manufacturers(*manufacturers)
          day_count = 0
          prev_day = self
          while day_count < num_days
            prev_day -= 1.days
            if prev_day.factory_day?(*manufacturers)
              day_count += 1
            end
          end
          prev_day
        end

        def days_calculator(until_date, *manufacturers)
          holidays_count = Holidays.between(self, until_date, *manufacturers).size
          weekends_count = (self...until_date).count { |dt| business_weekends(*manufacturers).include?(dt) }
{'fraction_non_alphanumeric': 0.07897153351698806, 'fraction_numerical': 0.006121824303642486, 'mean_word_length': 2.175898931000972, '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': '1313435', 'n_tokens_mistral': 910, 'n_tokens_neox': 868, 'n_words': 178}