<commit_before># Copyright (c) 2016 <NAME>

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

require 'dizby/protocol/manager'
require 'dizby/distributed/object'
require 'dizby/utility/configurable'
require 'dizby/utility/log'

require 'poly_delegate'

module Dizby
  class AbstractServer
    include PolyDelegate::Delegated
    extend Configurable

    def initialize(config, &log_transform)
      @config = config
      @log = Dizby::Logger.new(config[:log] || {}, &log_transform)
    end

    attr_reader :log
    config_reader :load_limit

    def connect_to(client_args)
      ProtocolManager.open_client(self, client_args)
    end

    def spawn_on(spawn_args)
      ProtocolManager.spawn_server(self, spawn_args)
    end

    def shutdown; end

    def close
      @log.close
    end

    def alive?
      true
    end

    def make_distributed(obj, error)
      if error
        RemoteDistributedError.new(obj)
      else
        log.debug("making distributed: #{obj.inspect}")
        DistributedObject.new(obj, self)
      end
    end
  end
end
<commit_msg>Allow all server configuration to be accessed besides config_reader<commit_after># Copyright (c) 2016 <NAME>

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

require 'dizby/protocol/manager'
require 'dizby/distributed/object'
require 'dizby/utility/configurable'
require 'dizby/utility/log'

require 'poly_delegate'

module Dizby
  class AbstractServer
    include PolyDelegate::Delegated
    extend Configurable

    def initialize(config, &log_transform)
      @config = config
      @log = Dizby::Logger.new(config[:log] || {}, &log_transform)
    end

    attr_reader :log, :config
    config_reader :load_limit

    def connect_to(client_args)
      ProtocolManager.open_client(self, client_args)
    end

    def spawn_on(spawn_args)
      ProtocolManager.spawn_server(self, spawn_args)
    end

    def shutdown; end

    def close
      @log.close
    end

    def alive?
      true
    end

    def make_distributed(obj, error)
      if error
        RemoteDistributedError.new(obj)
      else
        log.debug("making distributed: #{obj.inspect}")
        DistributedObject.new(obj, self)
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.08490188225871045, 'fraction_numerical': 0.006407689227072487, 'mean_word_length': 3.0551948051948052, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6859833', 'n_tokens_mistral': 804, 'n_tokens_neox': 767, 'n_words': 223}