code: def get_tf_record_writer(
      output_filename: str,
  ) -> tf.io.TFRecordWriter:
      tf_options = None
      if output_filename.endswith(".gz"):
          tf_options = tf.io.TFRecordOptions(compression_type="GZIP")
      return tf.io.TFRecordWriter(output_filename, options=tf_options)
  
imports: import json
  from typing import Optional
  from absl import logging
  import numpy
  import tensorflow
  from deepvariant.protos import deepvariant_pb2
  from third_party.nucleus.io import sharded_file_utils
  from third_party.nucleus.io import tfrecord
  from third_party.nucleus.protos import variants_pb2
  from tensorflow.core.example import example_pb2
label_desc: Use image node_id 27 for calling a global function with example usage: get_tf_record_writer(output_filename) and returns: tf