<commit_before>require 'logger'
require 'uri'

module Perpetuity
  class Configuration
    def initialize
      @logger = Logger.new(STDOUT)
    end

    def data_source *args
      if args.any?
        db = args.first

        case db
        when String
          args[0] = URI(args[0])
          @db = data_source_from_url(*args)
        when Symbol
          adapter = args.shift
          db_name = args.shift
          options = args.shift || {}
          adapter_class = adapter(adapter)

          @db = adapter_class.new(options.merge(db: db_name))
        end
      end

      @db
    end
<commit_msg>Set program name for logger<commit_after>require 'logger'
require 'uri'

module Perpetuity
  class Configuration
    def initialize
      @logger = Logger.new(STDOUT)
      @logger.progname = 'Perpetuity'
    end

    def data_source *args
      if args.any?
        db = args.first

        case db
        when String
          args[0] = URI(args[0])
          @db = data_source_from_url(*args)
        when Symbol
          adapter = args.shift
          db_name = args.shift
          options = args.shift || {}
          adapter_class = adapter(adapter)

          @db = adapter_class.new(options.merge(db: db_name))
        end
      end

      @db
    end

{'fraction_non_alphanumeric': 0.08555729984301413, 'fraction_numerical': 0.0031397174254317113, 'mean_word_length': 1.7899343544857769, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4406219', 'n_tokens_mistral': 385, 'n_tokens_neox': 373, 'n_words': 96}