code: def expand(
      self, metadata: beam.PCollection[DatasetCacheMetadata]
  ) -> beam.pvalue.PDone:
      return (
          metadata
          | "EncodeCacheMetadata" >> beam.Map(lambda x: x.encode())
          | "WriteCacheMetadata" >> beam.io.WriteToTFRecord(self._path)
      )
  
imports: import os
  import pickle
  import re
  import sys
  from typing import Iterable, Mapping, List, Optional, Union, Tuple
  import apache_beam
  import tensorflow
  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.expand(metadata) and returns: unknown