class_docstr: TFRecordWriter Test
class_docstr_tok: ["TFRecordWriter","Test"]
docstr: Validate compression with options_a and options_b and return size delta.
  
  Compress records with options_a and options_b. Uncompress both compressed
  files and assert that the contents match the original records. Finally
  calculate how much smaller the file compressed with options_a was than the
  file compressed with options_b.
  
  Args:
    records: The records to compress
    options_a: First set of options to compress with, the baseline for size.
    options_b: Second set of options to compress with.
  
  Returns:
    The difference in file size when using options_a vs options_b. A positive
    value means options_a was a better compression than options_b. A negative
    value means options_b had better compression than options_a.
docstr_tok: ["Validate","compression","with","options_a","and","options_b","and","return","size","delta",".","Compress","records","with","options_a","and","options_b",".","Uncompress","both","compressed","files","and","assert","that","the","contents","match","the","original","records",".","Finally","calculate","how","much","smaller","the","file","compressed","with","options_a","was","than","the","file","compressed","with","options_b",".","Args",":","records",":","The","records","to","compress","options_a",":","First","set","of","options","to","compress","with",",","the","baseline","for","size",".","options_b",":","Second","set","of","options","to","compress","with",".","Returns",":","The","difference","in","file","size","when","using","options_a","vs","options_b",".","A","positive","value","means","options_a","was","a","better","compression","than","options_b",".","A","negative","value","means","options_b","had","better","compression","than","options_a","."]
code: def _CompressionSizeDelta(self, records, options_a, options_b):
      """Validate compression with options_a and options_b and return size delta.
  
      Compress records with options_a and options_b. Uncompress both compressed
      files and assert that the contents match the original records. Finally
      calculate how much smaller the file compressed with options_a was than the
      file compressed with options_b.
  
      Args:
        records: The records to compress
        options_a: First set of options to compress with, the baseline for size.
        options_b: Second set of options to compress with.
  
      Returns:
        The difference in file size when using options_a vs options_b. A positive
        value means options_a was a better compression than options_b. A negative
        value means options_b had better compression than options_a.
  
      """
  
      fn_a = self._WriteRecordsToFile(
          records, "tfrecord_a", options=options_a
      )
      test_a = list(
          tf_record.tf_record_iterator(fn_a, options=options_a)
      )
      self.assertEqual(records, test_a, options_a)
  
      fn_b = self._WriteRecordsToFile(
          records, "tfrecord_b", options=options_b
      )
      test_b = list(
          tf_record.tf_record_iterator(fn_b, options=options_b)
      )
      self.assertEqual(records, test_b, options_b)
  
      # Negative number => better compression.
      return os.path.getsize(fn_a) - os.path.getsize(fn_b)
  
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 2 for calling the TFRecordWriterTest obj's underlying member method code with example usage: obj._CompressionSizeDelta(records, options_a, options_b) and returns: unknown