<commit_before># Ruby wrapper for the Zookeeper C API

require 'thread'
require 'monitor'
require 'forwardable'
require 'logger'

require 'backports'

module Zookeeper
  # establishes the namespace
end

require_relative 'zookeeper/acls'
require_relative 'zookeeper/constants'
require_relative 'zookeeper/exceptions'
require_relative 'zookeeper/common'
require_relative 'zookeeper/callbacks'
require_relative 'zookeeper/stat'
require_relative 'zookeeper/client_methods'

# ok, now we construct the client

require_relative 'zookeeper/client'

module Zookeeper
  include Constants

  unless defined?(@@logger)
    @@logger = Logger.new($stderr).tap { |l| l.level = Logger::ERROR } 
  end

  def self.logger
    @@logger
  end

  def self.logger=(logger)
    @@logger = logger
  end

  # @private
  def self.deprecation_warnings?
    @deprecation_warnings = true if @deprecation_warnings.nil?
  end

  # set this to false to mute Zookeeper related deprecation warnings...
  # __AT YOUR PERIL__
  def self.deprecation_warnings=(v)
    @deprecation_warnings = v
  end

  # @private
  def self.deprecation_warning(warning)
    Kernel.warn(warning) if deprecation_warnings?
  end

  # for expert use only. set the underlying debug level for the C layer, has no
  # effect in java
  #
  # @private
  def self.set_debug_level(val)
    if defined?(CZookeeper)
      CZookeeper.set_debug_level(val.to_i)
    end
  end

  # @private
  def self.get_debug_level
    if defined?(CZookeeper)
      CZookeeper.get_debug_level
    end
  end

  class << self
    # @private
    alias :debug_level= :set_debug_level
    
    # @private
    alias :debug_level :get_debug_level
  end
end

# just for first test, get rid of this soon
require 'zookeeper/compatibility'
<commit_msg>use require_relative<commit_after># Ruby wrapper for the Zookeeper C API

require 'thread'
require 'monitor'
require 'forwardable'
require 'logger'

require 'backports'

module Zookeeper
  # establishes the namespace
end

require_relative 'zookeeper/acls'
require_relative 'zookeeper/constants'
require_relative 'zookeeper/exceptions'
require_relative 'zookeeper/common'
require_relative 'zookeeper/callbacks'
require_relative 'zookeeper/stat'
require_relative 'zookeeper/client_methods'

# ok, now we construct the client

require_relative 'zookeeper/client'

module Zookeeper
  include Constants

  unless defined?(@@logger)
    @@logger = Logger.new($stderr).tap { |l| l.level = Logger::ERROR } 
  end

  def self.logger
    @@logger
  end

  def self.logger=(logger)
    @@logger = logger
  end

  # @private
  def self.deprecation_warnings?
    @deprecation_warnings = true if @deprecation_warnings.nil?
  end

  # set this to false to mute Zookeeper related deprecation warnings...
  # __AT YOUR PERIL__
  def self.deprecation_warnings=(v)
    @deprecation_warnings = v
  end

  # @private
  def self.deprecation_warning(warning)
    Kernel.warn(warning) if deprecation_warnings?
  end

  # for expert use only. set the underlying debug level for the C layer, has no
  # effect in java
  #
  # @private
  def self.set_debug_level(val)
    if defined?(CZookeeper)
      CZookeeper.set_debug_level(val.to_i)
    end
  end

  # @private
  def self.get_debug_level
    if defined?(CZookeeper)
      CZookeeper.get_debug_level
    end
  end

  class << self
    # @private
    alias :debug_level= :set_debug_level
    
    # @private
    alias :debug_level :get_debug_level
  end
end

# just for first test, get rid of this soon
require_relative 'zookeeper/compatibility'

{'fraction_non_alphanumeric': 0.07988668555240794, 'fraction_numerical': 0.0, 'mean_word_length': 3.9453781512605044, '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': '7272541', 'n_tokens_mistral': 1210, 'n_tokens_neox': 1167, 'n_words': 315}