def canonical_variable_name(variable_name: str, outer_scope: str):
    """Returns the canonical variable name: `outer_scope/.../name`."""
    name_parts = variable_name.split(":")[0].split("/")
    for i, part in enumerate(name_parts):
        if part == outer_scope:
            return "/".join(name_parts[i:])
    raise ValueError(f"Variable <{variable_name}> does not belong to <{outer_scope}>.")