<commit_before>module Courier
  SchemaSaveName = "courier.schema"
  CourierDatabaseName = "courier"
  MigrationLogSaveName = "migrations.log"

  class Courier
    attr_reader :migrator, :locks
    attr_accessor :url

    def self.instance
      @@instance ||= new
    end

    def initialize
      @locks = []
    end

    def locked?
      locks.count > 0
    end

    def lock_with(thread)
      @locks << thread
    end

    def unlock_with(thread)
      @locks.delete(thread)
    end

    def parcels=(parcels)
      @parcels = parcels
      build_all
    end

    def contexts
      @contexts
    end

    def save
      if locked?
        false
      else
        @contexts[:main].save
        true
      end
    end

    def migrate(msg = "")
      if @migrator.migrate_from(@persisted_schema, to:@schema)
        @schema.version = @persisted_schema.version + 1
        persist_schema
        log_schema(msg)
      end
      sync_schema_with_store
    end

    def last_schema
      puts @migrator.logs.last[:description]
    end

    def new_schema
      puts CoreData::SchemaDescription.new(@schema).describe
    end

    def new_context
      context_name = "context_" + (0...32).map{ (65+rand(26)).chr }.join
      @contexts[context_name] = CoreData::Context.new.tap do |context|
        context.store_coordinator = @store_coordinator<commit_msg>Removed superfluous methods that were not being used.<commit_after>module Courier
  SchemaSaveName = "courier.schema"
  CourierDatabaseName = "courier"
  MigrationLogSaveName = "migrations.log"

  class Courier
    attr_reader :migrator
    attr_accessor :url

    def self.instance
      @@instance ||= new
    end

    def parcels=(parcels)
      @parcels = parcels
      build_all
    end

    def contexts
      @contexts
    end

    def save

    def new_context
      context_name = "context_" + (0...32).map{ (65+rand(26)).chr }.join
      @contexts[context_name] = CoreData::Context.new.tap do |context|
        context.store_coordinator = @store_coordinator
{'fraction_non_alphanumeric': 0.08942687747035573, 'fraction_numerical': 0.007905138339920948, 'mean_word_length': 2.443877551020408, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '4973345', 'n_tokens_mistral': 669, 'n_tokens_neox': 632, 'n_words': 144}