<commit_before>module Rapns
  def self.config
    @config ||= Rapns::Configuration.new
  end

  def self.configure
    yield config if block_given?
  end

  CONFIG_ATTRS = [:foreground, :push_poll, :feedback_poll,
    :airbrake_notify, :check_for_errors, :pid_file, :batch_size]

  class Configuration < Struct.new(*CONFIG_ATTRS)
    attr_accessor :apns_feedback_callback

    def initialize
      super

      self.foreground = false
      self.push_poll = 2
      self.feedback_poll = 60
      self.airbrake_notify = true
      self.check_for_errors = true
      self.batch_size = 5000
    end

    def update(other)
      CONFIG_ATTRS.each { |attr| send("#{attr}=", other.send(attr)) }
    end

    def on_apns_feedback(&block)
      self.apns_feedback_callback = block
    end

    def pid_file=(path)
      if path && !Pathname.new(path).absolute?
        super(File.join(Rails.root, path))
      else
        super
      end
    end<commit_msg>Do not override if value is nil.<commit_after>module Rapns
  def self.config
    @config ||= Rapns::Configuration.new
  end

  def self.configure
    yield config if block_given?
  end

  CONFIG_ATTRS = [:foreground, :push_poll, :feedback_poll,
    :airbrake_notify, :check_for_errors, :pid_file, :batch_size]

  class Configuration < Struct.new(*CONFIG_ATTRS)
    attr_accessor :apns_feedback_callback

    def initialize
      super

      self.foreground = false
      self.push_poll = 2
      self.feedback_poll = 60
      self.airbrake_notify = true
      self.check_for_errors = true
      self.batch_size = 5000
    end

    def update(other)
      CONFIG_ATTRS.each do |attr|
        other_value = other.send(attr)
        send("#{attr}=", other_value) unless other_value.nil?
      end
    end

    def on_apns_feedback(&block)
      self.apns_feedback_callback = block
    end

    def pid_file=(path)
      if path && !Pathname.new(path).absolute?
        super(File.join(Rails.root, path))
      else
        super
      end
    end
{'fraction_non_alphanumeric': 0.09027081243731194, 'fraction_numerical': 0.007021063189568706, 'mean_word_length': 2.70817843866171, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1176331', 'n_tokens_mistral': 680, 'n_tokens_neox': 639, 'n_words': 143}