code: def write_metadata(parts, fmd, fs, path, append=False, **kwargs):
      if parts:
          # Aggregate metadata and write to _metadata file
          metadata_path = fs.sep.join([path, "_metadata"])
          _meta = []
          if append and fmd is not None:
              _meta = [fmd]
          _meta.extend([parts[i][0]["meta"] for i in range(len(parts))])
          _meta = (
              cudf.io.merge_parquet_filemetadata(_meta)
              if len(_meta) > 1
              else _meta[0]
          )
          with fs.open(metadata_path, "wb") as fil:
              fil.write(memoryview(_meta))
  
imports: import itertools
  import warnings
  from contextlib import ExitStack
  from functools import partial
  from io import BufferedWriter, BytesIO, IOBase
  import numpy
  from pyarrow import dataset, parquet
  from dask import dataframe
  from dask.dataframe.io.parquet.arrow import ArrowDatasetEngine
  import cudf
  from cudf.core.column import as_column, build_categorical_column
  from cudf.io import write_to_dataset
  from cudf.io.parquet import _apply_post_filters, _default_open_file_options, _normalize_filters
  from cudf.utils.dtypes import cudf_dtype_from_pa_type
  from cudf.utils.ioutils import _ROW_GROUP_SIZE_BYTES_DEFAULT, _is_local_filesystem, _open_remote_files
label_desc: Use image node_id 6 for calling the CudfEngine obj's underlying member method code with example usage: obj.write_metadata(parts, fmd, fs, path, append) without return types