class_docstr: Base class for setting up and testing FixedLengthRecordDataset.
class_docstr_tok: ["Base","class","for","setting","up","and","testing","FixedLengthRecordDataset","."]
code: def _createFiles(self, compression_type=None):
      filenames = []
      for i in range(self._num_files):
          fn = os.path.join(
              self.get_temp_dir(), "fixed_length_record.%d.txt" % i
          )
          filenames.append(fn)
  
          contents = []
          contents.append(b"H" * self._header_bytes)
          for j in range(self._num_records):
              contents.append(self._record(i, j))
          contents.append(b"F" * self._footer_bytes)
          contents = b"".join(contents)
  
          if not compression_type:
              with open(fn, "wb") as f:
                  f.write(contents)
          elif compression_type == "GZIP":
              with gzip.GzipFile(fn, "wb") as f:
                  f.write(contents)
          elif compression_type == "ZLIB":
              contents = zlib.compress(contents)
              with open(fn, "wb") as f:
                  f.write(contents)
          else:
              raise ValueError(
                  "Unsupported compression_type", compression_type
              )
  
      return filenames
  
imports: import gzip
  import os
  import pathlib
  import zlib
  from absl.testing import parameterized
  from tensorflow.python.data.kernel_tests import checkpoint_test_base
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import readers
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import errors
  from tensorflow.python.platform import test
  from tensorflow.python.util import compat
label_desc: Use image node_id 3 for calling the FixedLengthRecordDatasetTestBase obj's underlying member method code with example usage: obj._createFiles(compression_type) and returns: filenames