<commit_before># Copyright (c) 2010 VMware, Inc.  All Rights Reserved.
require 'rubygems'
require 'builder'
require 'nokogiri'
require 'net/http'
require 'pp'

class RbVmomi::TrivialSoap
  attr_accessor :debug, :cookie
  attr_reader :http

  def initialize opts
    fail unless opts.is_a? Hash
    @opts = opts
    return unless @opts[:host] # for testcases
    @debug = @opts[:debug]
    @cookie = nil
    @lock = Mutex.new
    @http = nil
    restart_http
  end

  def restart_http
    @http.finish if @http
    @http = Net::HTTP.new(@opts[:host], @opts[:port], @opts[:proxyHost], @opts[:proxyPort])
    if @opts[:ssl]
      require 'net/https'
      @http.use_ssl = true
      if @opts[:insecure]
        @http.verify_mode = OpenSSL::SSL::VERIFY_NONE
      else
        @http.verify_mode = OpenSSL::SSL::VERIFY_PEER
      end
      @http.cert = OpenSSL::X509::Certificate.new(@opts[:cert]) if @opts[:cert]
      @http.key = OpenSSL::PKey::RSA.new(@opts[:key]) if @opts[:key]
    end
    @http.set_debug_output(STDERR) if $DEBUG
    @http.read_timeout = 1000000000
    @http.open_timeout = 5
    def @http.on_connect<commit_msg>OS X doesnt support 1 billion second select timeouts<commit_after># Copyright (c) 2010 VMware, Inc.  All Rights Reserved.
require 'rubygems'
require 'builder'
require 'nokogiri'
require 'net/http'
require 'pp'

class RbVmomi::TrivialSoap
  attr_accessor :debug, :cookie
  attr_reader :http

  def initialize opts
    fail unless opts.is_a? Hash
    @opts = opts
    return unless @opts[:host] # for testcases
    @debug = @opts[:debug]
    @cookie = nil
    @lock = Mutex.new
    @http = nil
    restart_http
  end

  def restart_http
    @http.finish if @http
    @http = Net::HTTP.new(@opts[:host], @opts[:port], @opts[:proxyHost], @opts[:proxyPort])
    if @opts[:ssl]
      require 'net/https'
      @http.use_ssl = true
      if @opts[:insecure]
        @http.verify_mode = OpenSSL::SSL::VERIFY_NONE
      else
        @http.verify_mode = OpenSSL::SSL::VERIFY_PEER
      end
      @http.cert = OpenSSL::X509::Certificate.new(@opts[:cert]) if @opts[:cert]
      @http.key = OpenSSL::PKey::RSA.new(@opts[:key]) if @opts[:key]
    end
    @http.set_debug_output(STDERR) if $DEBUG
    @http.read_timeout = 1000000
    @http.open_timeout = 5
    def @http.on_connect
{'fraction_non_alphanumeric': 0.13414634146341464, 'fraction_numerical': 0.014808362369337979, 'mean_word_length': 3.3421550094517958, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '1178614', 'n_tokens_mistral': 829, 'n_tokens_neox': 790, 'n_words': 191}