<commit_before>module AwsSdb

  module Request

    class Base

      HOST = 'sdb.amazonaws.com'

      attr_accessor :account, :secret, :params

      def initialize(method, params, opts={})
        @account = opts[:account] || ENV['AMAZON_ACCESS_KEY_ID']
        @secret = opts[:secret] || ENV['AMAZON_SECRET_ACCESS_KEY']
        raise <<-end_msg unless @account && @secret
          Amazon AWS account or access key not defined
          Please pass {:account => 'your account', :secret => 'your secret'}
          as a last argument or define the following environment variables
          ENV['AMAZON_ACCESS_KEY_ID']
          ENV['AMAZON_SECRET_ACCESS_KEY']
        end_msg
        @method = method
        @params = params
        add_req_data_to_params
      end

      #Hostname for the request
      def host
        HOST
      end

      #Uri path
      def path
        '/'
      end

      #The full uri for the request, it takes the protocol as argument
      def uri(protocol = 'http')
        "#{protocol}://" + host + path + '?' + uri_query
      end

      #Only the query part of the uri<commit_msg>modified to include the AWS_ env params alongside the AMAZON_ ones.<commit_after>module AwsSdb

  module Request

    class Base

      HOST = 'sdb.amazonaws.com'

      attr_accessor :account, :secret, :params

      def initialize(method, params, opts={})
        @account = opts[:account] || (ENV['AMAZON_ACCESS_KEY_ID'] || ENV['AWS_ACCESS_KEY_ID'])
        @secret = opts[:secret] || (ENV['AMAZON_SECRET_ACCESS_KEY'] || ENV['AWS_SECRET_ACCESS_KEY'])
        raise <<-end_msg unless @account && @secret
          Amazon AWS account or access key not defined
          Please pass {:account => 'your account', :secret => 'your secret'}
          as a last argument or define the following environment variables
          ENV['AMAZON_ACCESS_KEY_ID']
          ENV['AMAZON_SECRET_ACCESS_KEY']
        end_msg
        @method = method
        @params = params
        add_req_data_to_params
      end

      #Hostname for the request
      def host
        HOST
      end

      #Uri path
      def path
        '/'
      end

      #The full uri for the request, it takes the protocol as argument
      def uri(protocol = 'http')
        "#{protocol}://" + host + path + '?' + uri_query
      end

      #Only the query part of the uri
{'fraction_non_alphanumeric': 0.0939625850340136, 'fraction_numerical': 0.0, 'mean_word_length': 2.2590027700831024, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6858256', 'n_tokens_mistral': 708, 'n_tokens_neox': 675, 'n_words': 215}