<commit_before>module TropoRest
  class Client
    module Session

      PLURAL_PATH = "sessions".freeze

      # Creates a session for the given token
      #
      # @param token [String] The token of the application.
      # @param params [Hash] The parameters to pass to the session.
      # @return [Hashie::Mash] The session object.
      # @see https://www.tropo.com/docs/rest/starting_session.htm
      def create_session(token, params={})
        params.merge!('token' => token)
        params.merge!(params) { |k,v| v.to_s } # custom parameters must be strings
        post(PLURAL_PATH, params)
      end

    end
  end
end<commit_msg>ID returned when calling create_session is stripped of the trailing CRLF.<commit_after>module TropoRest
  class Client
    module Session

      PLURAL_PATH = "sessions".freeze

      # Creates a session for the given token
      #
      # @param token [String] The token of the application.
      # @param params [Hash] The parameters to pass to the session.
      # @return [Hashie::Mash] The session object.
      # @see https://www.tropo.com/docs/rest/starting_session.htm
      def create_session(token, params={})
        params.merge!('token' => token)
        params.merge!(params) { |k,v| v.to_s } # custom parameters must be strings
        response = post(PLURAL_PATH, params)
        response.id = response.id.strip if response.id
        response
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.09560362875087229, 'fraction_numerical': 0.0, 'mean_word_length': 2.6395939086294415, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '7127871', 'n_tokens_mistral': 431, 'n_tokens_neox': 415, 'n_words': 133}