keras/src/backend/common/name_scope.py/current_path
def current_path():
    name_scope_stack = global_state.get_global_attribute("name_scope_stack")
    if name_scope_stack is None:
        return ""
    parts = []
    for entry in name_scope_stack:
        if entry.override_parent is not None:
            parts = [p for p in entry.override_parent.split("/") if p]
        parts.append(entry.name)
    return "/".join(parts)