def METHOD_NAME(fname, outdir, pathname):
    """Run dataset conversion tree."""
    # note: lower level h5py access is required in order to visit links
    with h5py.File(fname, "r") as fid:
        if pathname in fid:
            obj = fid[pathname]
            if isinstance(obj, h5py.Group):
                root = h5py.h5g.open(obj.id, b".")
                root.links.visit(partial(extract, outdir, obj))
            elif isinstance(obj, h5py.Dataset):
                name = pbasename(obj.name).encode("utf-8")
                extract(outdir, obj.parent, name)
            else:
                return
        else:
            msg = "{pathname} not found in {fname}"
            print(msg.format(pathname=pathname, fname=fname))
            return