<commit_before>class Facts
  module Extensions
    module Facter
      # First accommodate Classic Facter
      require 'facter' if ENV['SLOW_FACTER_PLEASE']

      # Then, failing that, attempt to load Native Facter
      unless Object.const_defined? 'Facter'
        begin
          require "#{ENV['FACTERDIR'] || '/usr'}/lib/libfacter.so"
        rescue LoadError
          raise LoadError, 'libfacter was not found. Please make sure it was installed to the expected location.'
        end
      end
    end
  end
end
<commit_msg>Use puppet agent location for libfacter<commit_after># frozen_string_literal: true

class Facts
  module Extensions
    module Facter
      # First accommodate Classic Facter
      require 'facter' if ENV['SLOW_FACTER_PLEASE']

      # Then, failing that, attempt to load Native Facter
      unless Object.const_defined? 'Facter'
        begin
          require "#{ENV['FACTERDIR'] || '/opt/puppetlabs/puppet'}/lib/libfacter.so"
        rescue LoadError
          raise LoadError, 'libfacter was not found. Please make sure it was installed to the expected location.'
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.07186678352322524, 'fraction_numerical': 0.0, 'mean_word_length': 2.6838709677419357, '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': '3688308', 'n_tokens_mistral': 331, 'n_tokens_neox': 327, 'n_words': 112}