def METHOD_NAME(resource_name, object_uri):
    """Returns object_uri"""
    obj_parts = object_uri.split("/")
    for length in range(len(obj_parts) + 1):
        parent_uri = "/".join(obj_parts[:length])
        parent_resource_name, _ = _resource_endpoint(parent_uri)
        if resource_name == parent_resource_name:
            return parent_uri
    error_msg = f"Cannot get URL of resource '{resource_name}' from parent '{object_uri}'."
    raise ValueError(error_msg)