def METHOD_NAME(fidin, in_id, nodes, fidout):
    """Copy directory subtrees from fidin to fidout."""
    if len(nodes) <= 0:
        return
    if not isinstance(nodes, list):
        nodes = [nodes]
    for node in nodes:
        start_block(fidout, node["block"])
        if node["id"] is not None:
            if in_id is not None:
                write_id(fidout, FIFF.FIFF_PARENT_FILE_ID, in_id)
            write_id(fidout, FIFF.FIFF_BLOCK_ID, in_id)
            write_id(fidout, FIFF.FIFF_PARENT_BLOCK_ID, node["id"])
        if node["directory"] is not None:
            for d in node["directory"]:
                #   Do not copy these tags
                if (
                    d.kind == FIFF.FIFF_BLOCK_ID
                    or d.kind == FIFF.FIFF_PARENT_BLOCK_ID
                    or d.kind == FIFF.FIFF_PARENT_FILE_ID
                ):
                    continue
                #   Read and write tags, pass data through transparently
                fidin.seek(d.pos, 0)
                tag = Tag(*np.fromfile(fidin, (">i4,>I4,>i4,>i4"), 1)[0])
                tag.data = np.fromfile(fidin, ">B", tag.size)
                _write(fidout, tag.data, tag.kind, 1, tag.type, ">B")
        for child in node["children"]:
            METHOD_NAME(fidin, in_id, child, fidout)
        end_block(fidout, node["block"])