def __init__(self, window_id, title, slot_count,
                 inv_type=None, persistent_slots=None, eid=None):
        assert not inv_type or inv_type == self.inv_type, \
            'inv_type differs: %s instead of %s' % (inv_type, self.inv_type)
        self.is_storage = slot_count > 0  # same after re-opening window
        if not self.is_storage:  # get number of temporary slots
            window_dict = windows_by_id[inv_type]
            if 'slots' in window_dict:
                slot_count = max(slot['index'] + slot.get('size', 1)
                                 for slot in window_dict['slots'])
        self.window_id = window_id
        self.title = title
        self.eid = eid  # used for horses

        # window slots vary, but always end with main inventory and hotbar
        # create own slots, ...
        self.slots = [Slot(self, slot_nr) for slot_nr in range(slot_count)]
        # ... append persistent slots (main inventory and hotbar)
        if persistent_slots is None:
            for slot_nr in range(constants.INV_SLOTS_PERSISTENT):
                self.slots.append(Slot(self, slot_nr + slot_count))
        else:  # persistent slots have to be moved from other inventory
            moved_slots = persistent_slots[-constants.INV_SLOTS_PERSISTENT:]
            for slot_nr, moved_slot in enumerate(moved_slots):
                moved_slot.move_to_window(self, slot_nr + slot_count)
                self.slots.append(moved_slot)

        # additional info dependent on inventory type,
        # dynamically updated by server
        self.properties = {}
dataset/ETHPy150Open SpockBotMC/SpockBot/spockbot/mcdata/windows.py/Window.__init__/original