def equip(self, slot, admiral_equip_id=None):
        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)
Replace a Kanmusu equipment
dataset/ETHPy150Open KanColleTool/kcsrv/db/ships.py/Kanmusu.equip