<commit_before>module Fog
  module StormOnDemand
    module RealShared

      API_URL = 'https://api.stormondemand.com'
      API_VERSION = 'v1'
      
      def initialize(options={})
        uri = URI.parse(options[:storm_on_demand_auth_url] ||= API_URL)
        @connection_options = options[:connection_options] || {}
        @host       = uri.host
        @path       = uri.path
        @persistent = options[:persistent] || false
        @port       = uri.port
        @scheme     = uri.scheme
        @storm_on_demand_username = options[:storm_on_demand_username]
        @storm_on_demand_password = options[:storm_on_demand_password]
        @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
      end

      def reload
        @connection.reset
      end

      def request(params)
        begin
          response = @connection.request(params.merge!({
            :headers  => {
              'Content-Type' => 'application/json',
              'Authorization' => 'Basic ' << Base64.encode64("#{@storm_on_demand_username}:#{@storm_on_demand_password}").chomp
            }.merge!(params[:headers] || {}),
            :host     => @host,
            :path     => "#{@path}/#{API_VERSION}#{params[:path]}",
            :expects  => 200,
            :method   => :post
          }))<commit_msg>[storm_on_demand] don't pass host to request<commit_after>module Fog
  module StormOnDemand
    module RealShared

      API_URL = 'https://api.stormondemand.com'
      API_VERSION = 'v1'
      
      def initialize(options={})
        uri = URI.parse(options[:storm_on_demand_auth_url] ||= API_URL)
        @connection_options = options[:connection_options] || {}
        @host       = uri.host
        @path       = uri.path
        @persistent = options[:persistent] || false
        @port       = uri.port
        @scheme     = uri.scheme
        @storm_on_demand_username = options[:storm_on_demand_username]
        @storm_on_demand_password = options[:storm_on_demand_password]
        @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
      end

      def reload
        @connection.reset
      end

      def request(params)
        begin
          response = @connection.request(params.merge!({
            :headers  => {
              'Content-Type' => 'application/json',
              'Authorization' => 'Basic ' << Base64.encode64("#{@storm_on_demand_username}:#{@storm_on_demand_password}").chomp
            }.merge!(params[:headers] || {}),
            :path     => "#{@path}/#{API_VERSION}#{params[:path]}",
            :expects  => 200,
            :method   => :post
          }))
{'fraction_non_alphanumeric': 0.1419593345656192, 'fraction_numerical': 0.005914972273567467, 'mean_word_length': 2.28, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 16, 'https://': 2, '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': '3290175', 'n_tokens_mistral': 820, 'n_tokens_neox': 792, 'n_words': 125}