<commit_before># 3rd party
require 'toml'
require 'webrick'
require 'json'
require 'net/http'
require 'uri'
require 'agent'

# internal requires
require 'bitweavd-info'
require 'bitweavd/cmd_daemon'
require 'bitweavd/cmd_rpc'
require 'bitweavd/config'
require 'bitweavd/core_ext'
require 'bitweavd/client_api'

module BitWeavD
  def self.find_external_ip
    external_ip = ''
    
    # The json response looks like:
    # {"ip": "192.168.3.11"}
    uri = URI.parse 'http://ip.jsontest.com/'
    Net::HTTP.get_response(uri) { |res| external_ip = JSON.parse(res.body)["ip"] }
    # XXX check if this doesn't work
    
    puts "External IP is #{external_ip}"
  end
end<commit_msg>Even more refactoring of Extrnal IP retrevial<commit_after># 3rd party
require 'toml'
require 'webrick'
require 'json'
require 'net/http'
require 'agent'

# internal requires
require 'bitweavd-info'
require 'bitweavd/cmd_daemon'
require 'bitweavd/cmd_rpc'
require 'bitweavd/config'
require 'bitweavd/core_ext'
require 'bitweavd/client_api'

module BitWeavD
  def self.find_external_ip
    external_ip = ''
    
    # The json response looks like:
    # {"ip": "192.168.3.11"}
    Net::HTTP.get_response(URI('http://ip.jsontest.com/')) { |res| external_ip = JSON.parse(res.body)["ip"] }
    # XXX check if this doesn't work
    
    puts "External IP is #{external_ip}"
  end
end
{'fraction_non_alphanumeric': 0.12822402358142962, 'fraction_numerical': 0.014738393515106854, 'mean_word_length': 4.143939393939394, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3548939', 'n_tokens_mistral': 515, 'n_tokens_neox': 500, 'n_words': 122}