<commit_before>class Bignum
  # Extend Fixnum to enable 10.cycles
  def cycles
    if block_given?
      times do
        yield
        Origen.app.tester.cycle
      end
    else
      Origen.app.tester.cycle(repeat: self)
    end
  end
  alias_method :cycle, :cycles

  alias_method :old_bit_select, :[]
  def [](*args)
    if args.length == 1 && !args.first.is_a?(Range)
      old_bit_select(args.first)
    else
      if args.first.is_a?(Range)
        msb = args.first.first
        lsb = args.first.last
      else
        msb = args.first
        lsb = args.last
      end
      (self >> lsb) & 0.ones_comp(msb - lsb + 1)
    end
  end

  def ones_comp(num_bits)
    self ^ ((1 << num_bits) - 1)
  end
  alias_method :ones_complement, :ones_comp
  alias_method :ones_compliment, :ones_comp
end
<commit_msg>Patch for Ruby 2.4.0 compatibility<commit_after>unless Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4.0')
  class Bignum
    # Extend Fixnum to enable 10.cycles
    def cycles
      if block_given?
        times do
          yield
          Origen.app.tester.cycle
        end
      else
        Origen.app.tester.cycle(repeat: self)
      end
    end
    alias_method :cycle, :cycles

    alias_method :old_bit_select, :[]
    def [](*args)
      if args.length == 1 && !args.first.is_a?(Range)
        old_bit_select(args.first)
      else
        if args.first.is_a?(Range)
          msb = args.first.first
          lsb = args.first.last
        else
          msb = args.first
          lsb = args.last
        end
        (self >> lsb) & 0.ones_comp(msb - lsb + 1)
      end
    end

    def ones_comp(num_bits)
      self ^ ((1 << num_bits) - 1)
    end
    alias_method :ones_complement, :ones_comp
    alias_method :ones_compliment, :ones_comp
  end
end

{'fraction_non_alphanumeric': 0.1031390134529148, 'fraction_numerical': 0.011210762331838564, 'mean_word_length': 2.0357142857142856, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, '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': '5874211', 'n_tokens_mistral': 650, 'n_tokens_neox': 628, 'n_words': 142}