<commit_before># Make virtualenv version available as a fact

Facter.add("virtualenv_version") do
  setcode do
    if Facter::Util::Resolution.which('virtualenv')
      Facter::Util::Resolution.exec('virtualenv --version 2>&1').match(/^(\d+\.\d+\.?\d*).*$/)[0]
    end
  end
end<commit_msg>Update virtualenv_version.rb<commit_after># Make virtualenv version available as a fact

Facter.add("virtualenv_version") do
  setcode do
    if Facter::Util::Resolution.which('virtualenv')
      Facter::Util::Resolution.exec('virtualenv --version 2>/dev/null || echo 0.0.0').match(/^(\d+\.\d+\.?\d*).*$/)[0]
    end
  end
end
{'fraction_non_alphanumeric': 0.18831168831168832, 'fraction_numerical': 0.012987012987012988, 'mean_word_length': 4.228813559322034, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6591006', 'n_tokens_mistral': 217, 'n_tokens_neox': 209, 'n_words': 42}