def METHOD_NAME(pathname):
    """Given a runpath to a BUILD file in the current Bazel workspace, returns
    where it should live in the user's drake.bzl workspace (in their installed
    copy of a Drake binary release).
    """
    # For example, it respells
    #   external/drake_models/BUILD.bazel
    # into
    #   external-drake_models-BUILD.bazel
    # or
    #   drake__examples.BUILD.bazel
    # into
    #   examples/BUILD.bazel
    if pathname.startswith("external"):
        return pathname.replace("/", "-")
    result = os.path.basename(pathname)
    result = result.replace("__", "/").replace(".BUILD.bazel", "/BUILD.bazel")
    assert result.startswith("drake/")
    result = result[len("drake/"):]
    return result