code: def write_tfrecord_file(file_name: str, *proto: Message) -> None:
      """Writes a serialized tfrecord to file."""
      try:
          import tensorflow as tf  # pytype: disable=import-error # pylint: disable=g-import-not-at-top
      except ModuleNotFoundError as e:
          raise Exception(
              "TensorFlow must be installed to use this functionality."
          ) from e
      fileio.makedirs(os.path.dirname(file_name))
      with tf.io.TFRecordWriter(file_name) as writer:
          for message in proto:
              writer.write(message.SerializeToString())
  
imports: import os
  import re
  import tempfile
  from typing import List, TypeVar, Iterable
  from tfx.dsl.io import fileio
  from google.protobuf import json_format
  from google.protobuf import text_format
  from google.protobuf.message import Message
label_desc: Use image node_id 9 for calling a global function with example usage: write_tfrecord_file(file_name) without return types