<commit_before>module VMDB
  module Util
    def self.http_proxy_uri(proxy_config = :default)
      # TODO: (julian) This looks really messy. Need to make it look nicer.

      proxy = ::Settings.http_proxy[proxy_config].to_hash
      proxy = ::Settings.http_proxy.to_hash unless proxy[:host]
      return nil unless proxy[:host]

      user     = proxy.delete(:user)
      user &&= CGI.escape(user)
      password = proxy.delete(:password)
      password &&= CGI.escape(password)
      userinfo = "#{user}:#{password}".chomp(":") unless user.blank?

      proxy[:userinfo]   = userinfo
      proxy[:scheme] ||= "http"
      proxy[:port] &&= proxy[:port].to_i

      URI::Generic.build(proxy)<commit_msg>Removed TODO: as no longer needed.<commit_after>module VMDB
  module Util
    def self.http_proxy_uri(proxy_config = :default)
      proxy = ::Settings.http_proxy[proxy_config].to_hash
      proxy = ::Settings.http_proxy.to_hash unless proxy[:host]
      return nil unless proxy[:host]

      user     = proxy.delete(:user)
      user &&= CGI.escape(user)
      password = proxy.delete(:password)
      password &&= C<PASSWORD>(password)
      userinfo = "#{user}:#{password}".chomp(":") unless user.blank?

      proxy[:userinfo]   = userinfo
      proxy[:scheme] ||= "http"
      proxy[:port] &&= proxy[:port].to_i

      URI::Generic.build(proxy)
{'fraction_non_alphanumeric': 0.14412416851441243, 'fraction_numerical': 0.0, 'mean_word_length': 3.23125, 'pattern_counts': {'":': 2, '<': 4, '<?xml version=': 0, '>': 4, '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': '1825541', 'n_tokens_mistral': 427, 'n_tokens_neox': 420, 'n_words': 88}