def METHOD_NAME(tmp_path):
    exttree = {
        # Include some ~ and / in the name to make sure that escaping
        # is working correctly
        "f~o~o/": {"a": np.array([0, 1, 2], float), "b": np.array([3, 4, 5], float)},
    }
    external_path = os.path.join(str(tmp_path), "external.asdf")
    ext = asdf.AsdfFile(exttree)
    ext.write_to(external_path)
    with asdf.open(external_path) as ext:
        ff = asdf.AsdfFile()
        ff.tree["ref"] = ext.make_reference(["f~o~o/", "a"])
        assert_array_equal(ff.tree["ref"], ext.tree["f~o~o/"]["a"])
        ff.write_to(os.path.join(str(tmp_path), "source.asdf"))
    with asdf.open(os.path.join(str(tmp_path), "source.asdf")) as ff:
        assert ff.tree["ref"]._uri == "external.asdf#f~0o~0o~1/a"