<commit_before>
require 'uri'
require 'net/http'
begin
  require 'chef/http/http_request' # Chef >= 11.8
rescue LoadError
  require 'chef/rest/rest_request' # Chef <= 11.6.2
end

module PostfixAdmin
  module API
    @@cookie = nil
    @@authenticated = false

    def self.request(method, path, body, ssl=false)
      proto = ssl ? 'https' : 'http'
      port = ssl ? 443 : 80
      uri = URI.parse("#{proto}://localhost:#{port}#{path}")
      http = Net::HTTP.new(uri.host, uri.port)
      if ssl
        require 'net/https'
        http.use_ssl = true
        http.verify_mode = OpenSSL::SSL::VERIFY_NONE
      end
      # http.set_debug_output $stderr # DEBUG<commit_msg>PostfixAdmin::API: removed some not needed requires<commit_after>
module PostfixAdmin
  module API
    @@cookie = nil
    @@authenticated = false

    def self.request(method, path, body, ssl=false)
      proto = ssl ? 'https' : 'http'
      port = ssl ? 443 : 80
      uri = URI.parse("#{proto}://localhost:#{port}#{path}")
      http = Net::HTTP.new(uri.host, uri.port)
      if ssl
        require 'net/https'
        http.use_ssl = true
        http.verify_mode = OpenSSL::SSL::VERIFY_NONE
      end
      # http.set_debug_output $stderr # DEBUG
{'fraction_non_alphanumeric': 0.13327882256745707, 'fraction_numerical': 0.013900245298446443, 'mean_word_length': 2.743119266055046, 'pattern_counts': {'":': 0, '<': 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': '4464332', 'n_tokens_mistral': 429, 'n_tokens_neox': 408, 'n_words': 98}