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.
code: def _extract_input_pvalues(self, metadata):
      pvalues = []
      if isinstance(metadata, BeamDatasetMetadata):
          pvalues.append(metadata.deferred_metadata)
      return metadata, pvalues
  
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 2 for calling the WriteMetadata obj's underlying member method code with example usage: obj._extract_input_pvalues(metadata) and returns: metadata,  pvalues