<commit_before># dns_lookup.rb
# does a DNS lookup and returns an array of strings of the results

module Puppet::Parser::Functions
  newfunction(:dns_lookup, :type => :rvalue, :doc => <<-EOS
    Does a DNS lookup and returns an array of addresses.
    EOS
  ) do |arguments|
    require 'resolv'

    Resolv::DNS.new.getaddresses(arguments[0]).collect do |res|
      res.address.to_s
    end
  end
end<commit_msg>Fix conversion of IP address, don't use raw address<commit_after># dns_lookup.rb
# does a DNS lookup and returns an array of strings of the results

module Puppet::Parser::Functions
  newfunction(:dns_lookup, :type => :rvalue, :doc => <<-EOS
    Does a DNS lookup and returns an array of addresses.
    EOS
  ) do |arguments|
    require 'resolv'

    Resolv::DNS.new.getaddresses(arguments[0]).collect do |res|
      res.to_s
    end
  end
end
{'fraction_non_alphanumeric': 0.10139860139860139, 'fraction_numerical': 0.002331002331002331, 'mean_word_length': 3.618279569892473, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6803295', 'n_tokens_mistral': 286, 'n_tokens_neox': 282, 'n_words': 95}