<commit_before>require 'base64'
require 'net/https'
require 'json'

module Mixpanel
  class ConnectionError < IOError
  end
  
  class ServerError < IOError
  end

  @@init_http = nil

  # This method exists for backwards compatibility. The preferred
  # way to customize or configure the HTTP library of a consumer
  # is to override Consumer#request.
  #
  # Ruby's default SSL does not verify the server certificate.
  # To verify a certificate, or install a proxy, pass a block
  # to Mixpanel.config_http that configures the Net::HTTP object.
  # For example, if running in Ubuntu Linux, you can run
  #
  #    Mixpanel.config_http do |http|
  #        http.ca_path = '/etc/ssl/certs'
  #        http.ca_file = '/etc/ssl/certs/ca-certificates.crt'
  #        http.verify_mode = OpenSSL::SSL::VERIFY_PEER
  #    end
  #
  # \Mixpanel Consumer and BufferedConsumer will call your block
  # to configure their connections
  def self.config_http(&block)<commit_msg>Update consumer.rb<commit_after>require 'base64'
require 'net/https'
require 'json'

module Mixpanel
  class MixpanelError < Error
  end
  
  class ConnectionError < MixpanelError
  end
  
  class ServerError < MixpanelError
  end

  @@init_http = nil

  # This method exists for backwards compatibility. The preferred
  # way to customize or configure the HTTP library of a consumer
  # is to override Consumer#request.
  #
  # Ruby's default SSL does not verify the server certificate.
  # To verify a certificate, or install a proxy, pass a block
  # to Mixpanel.config_http that configures the Net::HTTP object.
  # For example, if running in Ubuntu Linux, you can run
  #
  #    Mixpanel.config_http do |http|
  #        http.ca_path = '/etc/ssl/certs'
  #        http.ca_file = '/etc/ssl/certs/ca-certificates.crt'
  #        http.verify_mode = OpenSSL::SSL::VERIFY_PEER
  #    end
  #
  # \Mixpanel Consumer and BufferedConsumer will call your block
  # to configure their connections
  def self.config_http(&block)
{'fraction_non_alphanumeric': 0.07746478873239436, 'fraction_numerical': 0.002012072434607646, 'mean_word_length': 3.2958963282937366, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 3, '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': '7222591', 'n_tokens_mistral': 615, 'n_tokens_neox': 591, 'n_words': 208}