<commit_before>require 'rubygems'
require 'socket'
require 'fastthread' if RUBY_VERSION < '1.9'
require 'thread'
require 'monitor'
require 'yaml'
require 'digest/md5'
require 'logger'

require 'pandemic/util'
require 'pandemic/connection_pool'
require 'pandemic/mutex_counter'

require 'pandemic/server_side/config'
require 'pandemic/server_side/client'
require 'pandemic/server_side/server'
require 'pandemic/server_side/peer'
require 'pandemic/server_side/request'
require 'pandemic/server_side/handler'

require 'pandemic/client_side/config'
require 'pandemic/client_side/cluster_connection'
require 'pandemic/client_side/connection'
require 'pandemic/client_side/connection_proxy'
require 'pandemic/client_side/pandemize'

# TODO:
# - tests
# - IO timeouts/robustness
# - documentation
# - PING/PONG?

TCP_NO_DELAY_AVAILABLE =
    RUBY_VERSION < '1.9' ? Socket.constants.include?('TCP_NODELAY') : Socket.constants.include?(:TCP_NODELAY)

def epidemic!
  if $pandemic_logger.nil?
    $pandemic_logger = Logger.new("pandemic.log")
    $pandemic_logger.level = Logger::INFO
    $pandemic_logger.datetime_format = "%Y-%m-%d %H:%M:%S "
  end
  Pandemic::ServerSide::Server.boot
end

::Pandemize = Pandemic::ClientSide::Pandemize<commit_msg>you can send bind_to through the epidemic! method<commit_after>require 'rubygems'
require 'socket'
require 'fastthread' if RUBY_VERSION < '1.9'
require 'thread'
require 'monitor'
require 'yaml'
require 'digest/md5'
require 'logger'

require 'pandemic/util'
require 'pandemic/connection_pool'
require 'pandemic/mutex_counter'

require 'pandemic/server_side/config'
require 'pandemic/server_side/client'
require 'pandemic/server_side/server'
require 'pandemic/server_side/peer'
require 'pandemic/server_side/request'
require 'pandemic/server_side/handler'

require 'pandemic/client_side/config'
require 'pandemic/client_side/cluster_connection'
require 'pandemic/client_side/connection'
require 'pandemic/client_side/connection_proxy'
require 'pandemic/client_side/pandemize'

# TODO:
# - tests
# - IO timeouts/robustness
# - documentation
# - PING/PONG?

TCP_NO_DELAY_AVAILABLE =
    RUBY_VERSION < '1.9' ? Socket.constants.include?('TCP_NODELAY') : Socket.constants.include?(:TCP_NODELAY)

def epidemic!(bind_to = nil)
  if $pandemic_logger.nil?
    $pandemic_logger = Logger.new("pandemic.log")
    $pandemic_logger.level = Logger::INFO
    $pandemic_logger.datetime_format = "%Y-%m-%d %H:%M:%S "
  end
  Pandemic::ServerSide::Server.boot(bind_to)
end

::Pandemize = Pandemic::ClientSide::Pandemize
{'fraction_non_alphanumeric': 0.12371946414499606, 'fraction_numerical': 0.003940110323089046, 'mean_word_length': 6.380813953488372, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3573391', 'n_tokens_mistral': 917, 'n_tokens_neox': 907, 'n_words': 155}