def METHOD_NAME(data, out_prefix):
    key_targs = {
        "codes": f"{out_prefix}.code.npy",
        "duration": f"{out_prefix}.dur.npy",
        "f0": f"{out_prefix}.f0.npy",
    }
    for key, targ in key_targs.items():
        assert not os.path.exists(targ)
        npaa = NpyAppendArray(targ)
        for utt_data in tqdm(data[key], desc=f"dumping {key}"):
            npaa.append(utt_data.numpy())
    assert not os.path.exists(f"{out_prefix}.path.txt")
    with open(f"{out_prefix}.path.txt", "w") as f:
        for x in data["path"]:
            f.write(f"{str(x)}\n")
    assert not os.path.exists(f"{out_prefix}.leng.txt")
    with open(f"{out_prefix}.leng.txt", "w") as f:
        for x in data["codes"]:
            f.write(f"{len(x)}\n")
    assert not os.path.exists(f"{out_prefix}.speaker.txt")
    with open(f"{out_prefix}.speaker.txt", "w") as f:
        for x in data["speaker"]:
            f.write(f"{str(x)}\n")
    print(f"wrote to files with prefix {out_prefix}")