keras/src/utils/tracking.py/TrackedList/remove
class TrackedList:    def remove(self, value):
        if self.tracker:
            self.tracker.untrack(value)
        try:
            super().remove(value)
        except ValueError:
            python_utils.remove_by_id(self, value)