keras/src/backend/common/name_scope.py/name_scope/__init__
class name_scope:    def __init__(
        self, name, caller=None, deduplicate=True, override_parent=None
    ):
        if not isinstance(name, str) or "/" in name:
            raise ValueError(
                "Argument `name` must be a string and "
                "cannot contain character `/`. "
                f"Received: name={name}"
            )
        self.name = name
        self.caller = caller
        self.deduplicate = deduplicate
        self.override_parent = override_parent
        if (
            override_parent is None
            and deduplicate
            and getattr(caller, "_parent_path", None) is not None
        ):
            self.override_parent = caller._parent_path
        self._pop_on_exit = False