<commit_before>require 'net/http/persistent'
require 'json'

require 'npm/mirror/version'
require 'npm/mirror/config'

module Npm
  module Mirror
    autoload :Pool, 'npm/mirror/pool'

    class Error < StandardError; end

    class Mirror
      attr_reader :from, :to, :server, :parallelism

      def initialize(from = DEFAULT_FROM, to = DEFAULT_TO,
                     server = DEFAULT_SERVER, parallelism = 10,
                     recheck = false)
        @from, @to, @server = from, to, server
        @pool = Pool.new parallelism
        @http = Net::HTTP::Persistent.new self.class.name
        @recheck = recheck

        puts "Mirroring  : #{from}"
        puts "Datadir    : #{to}"
        puts "Server     : #{server}"
        puts "Parallelism: #{parallelism}"
        puts "Recheck    : #{recheck}"
      end

      def from(*args)
        File.join @from, *args
      end

      def to(*args)
        File.join @to, *args
      end

      def link(*args)<commit_msg>fix: passing params<commit_after>require 'net/http/persistent'
require 'json'

require 'npm/mirror/version'
require 'npm/mirror/config'

module Npm
  module Mirror
    autoload :Pool, 'npm/mirror/pool'

    class Error < StandardError; end

    class Mirror
      attr_reader :from, :to, :server, :parallelism

      def initialize(from = DEFAULT_FROM, to = DEFAULT_TO,
                     server = DEFAULT_SERVER, parallelism = 10,
                     recheck = false)
        @from, @to, @server = from, to, server
        parallelism ||= 10
        check ||= false
        @pool = Pool.new parallelism
        @http = Net::HTTP::Persistent.new self.class.name
        @recheck = recheck

        puts "Mirroring  : #{from}"
        puts "Datadir    : #{to}"
        puts "Server     : #{server}"
        puts "Parallelism: #{parallelism}"
        puts "Recheck    : #{recheck}"
      end

      def from(*args)
        File.join @from, *args
      end

      def to(*args)
        File.join @to, *args
      end

      def link(*args)
{'fraction_non_alphanumeric': 0.11429985155863434, 'fraction_numerical': 0.0029688273132112814, 'mean_word_length': 2.0406015037593983, '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': '303118', 'n_tokens_mistral': 639, 'n_tokens_neox': 619, 'n_words': 167}