<commit_before>module Machinist
  class Shop

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

    def self.buy(*args)
      instance.buy(*args)
    end

    def self.reset_warehouse!
      instance.reset_warehouse!
    end

    def self.reset
      instance.reset
    end
    
    def initialize
      reset_warehouse!
    end
    
    def reset_warehouse!  # FIXME: Naming
      @warehouse = Warehouse.new
      reset
    end

    def reset  # FIXME: Naming
      @back_room = @warehouse.clone
    end

    def buy(blueprint, attributes = {})
      klass = blueprint.klass

      shelf = @back_room[blueprint, attributes]
      if shelf.empty?
        object = blueprint.outside_transaction { blueprint.make!(attributes) }
        @warehouse[blueprint, attributes] << blueprint.serialize(object)
        object
      else
        blueprint.instantiate(shelf.shift)
      end
    end
<commit_msg>Took out an unused line. Clean code is good code.<commit_after>module Machinist
  class Shop

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

    def self.buy(*args)
      instance.buy(*args)
    end

    def self.reset_warehouse!
      instance.reset_warehouse!
    end

    def self.reset
      instance.reset
    end
    
    def initialize
      reset_warehouse!
    end
    
    def reset_warehouse!  # FIXME: Naming
      @warehouse = Warehouse.new
      reset
    end

    def reset  # FIXME: Naming
      @back_room = @warehouse.clone
    end

    def buy(blueprint, attributes = {})
      shelf = @back_room[blueprint, attributes]
      if shelf.empty?
        object = blueprint.outside_transaction { blueprint.make!(attributes) }
        @warehouse[blueprint, attributes] << blueprint.serialize(object)
        object
      else
        blueprint.instantiate(shelf.shift)
      end
    end

{'fraction_non_alphanumeric': 0.07907742998352553, 'fraction_numerical': 0.0, 'mean_word_length': 2.1797556719022686, 'pattern_counts': {'":': 0, '<': 7, '<?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': '730548', 'n_tokens_mistral': 563, 'n_tokens_neox': 547, 'n_words': 129}