class_docstr: TFCompression Test
class_docstr_tok: ["TFCompression","Test"]
code: def _WriteRecordsToFile(self, records, name="tfrecord", options=None):
      fn = os.path.join(self.get_temp_dir(), name)
      with tf_record.TFRecordWriter(fn, options=options) as writer:
          for r in records:
              writer.write(r)
      return fn
  
imports: import gzip
  import os
  import random
  import string
  import zlib
  import six
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.lib.io import tf_record
  from tensorflow.python.platform import test
  from tensorflow.python.util import compat
label_desc: Use image node_id 4 for calling the TFCompressionTestCase obj's underlying member method code with example usage: obj._WriteRecordsToFile(records, name, options) and returns: fn