def equip(self, slot, admiral_equip_id=None):
        """
        Replace a Kanmusu equipment
        :param slot: The slot which make the operation
        :param admiral_equip_id: The ID of an AdmiralEquipment entry.
        """
        if int(admiral_equip_id) == -1:
            admiral_equip_id = None
        else:
            new_stats = self.admiral.get_equipment(admiral_equip_id).equipment.stats
            self.stats.add(new_stats)

        if self.equipments[int(slot)].admiral_equipment_id is not None:
            old_stats = self.equipments[int(slot)].admiral_equipment.equipment.stats
            self.stats.sub(old_stats)

        self.equipments[int(slot)].admiral_equipment_id = admiral_equip_id
        db.session.add(self)
dataset/ETHPy150Open KanColleTool/kcsrv/db/ships.py/Kanmusu.equip/original