class_docstr: A PTransform to write Metadata to disk.
  
  Input can either be a DatasetMetadata or a tuple of properties.
  
  Depending on the optional `write_to_unique_subdirectory`, writes the given
  metadata to either `path` or a new unique subdirectory under `path`.
  
  Returns a singleton with the path to which the metadata was written.
docstr: Init method.
  
  Args:
    path: A str, the default path that the metadata should be written to.
    pipeline: A beam Pipeline.
    write_to_unique_subdirectory: (Optional) A bool indicating whether to
      write the metadata out to `path` or a unique subdirectory under `path`.
docstr_tok: ["Init","method",".","Args",":","path",":","A","str",",","the","default","path","that","the","metadata","should","be","written","to",".","pipeline",":","A","beam","Pipeline",".","write_to_unique_subdirectory",":","(","Optional",")","A","bool","indicating","whether","to","write","the","metadata","out","to","`","path","`","or","a","unique","subdirectory","under","`","path","`","."]
code: def __init__(
      self, path, pipeline, write_to_unique_subdirectory=False
  ):
      """Init method.
  
      Args:
        path: A str, the default path that the metadata should be written to.
        pipeline: A beam Pipeline.
        write_to_unique_subdirectory: (Optional) A bool indicating whether to
          write the metadata out to `path` or a unique subdirectory under `path`.
      """
      super().__init__()
      self._path = path
      self._write_to_unique_subdirectory = write_to_unique_subdirectory
      self.pipeline = pipeline
  
file_path: transform/tensorflow_transform/beam/tft_beam_io/beam_metadata_io.py
imports: import json
  import os
  import apache_beam
  import tensorflow
  from tensorflow_transform import output_wrapper
  from tensorflow_transform.beam import common
  from tensorflow_transform.tf_metadata import metadata_io
  from tfx_bsl.types import tfx_namedtuple
label_desc: Use image node_id 1 to create a new WriteMetadata object from inherited base classes: beam with example: obj = WriteMetadata(path, pipeline, write_to_unique_subdirectory)