class_docstr: TFCompression Test
class_docstr_tok: ["TFCompression","Test"]
code: def _GzipCompressFile(self, infile, name="tfrecord.gz"):
      # gzip compress the file and write compressed contents to file.
      with open(infile, "rb") as f:
          cdata = f.read()
  
      gzfn = os.path.join(self.get_temp_dir(), name)
      with gzip.GzipFile(gzfn, "wb") as f:
          f.write(cdata)
      return gzfn
  
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 6 for calling the TFCompressionTestCase obj's underlying member method code with example usage: obj._GzipCompressFile(infile, name) and returns: gzfn