keras/src/models/sequential.py/Sequential/_is_layer_name_unique
class Sequential:    def _is_layer_name_unique(self, layer):
        for ref_layer in self._layers:
            if layer.name == ref_layer.name and ref_layer is not layer:
                return False
        return True