code: def __init__(
      self,
      tfrecord_dir,
      expected_images,
      print_progress=True,
      progress_interval=10,
  ):
      self.tfrecord_dir = tfrecord_dir
      self.tfr_prefix = os.path.join(
          self.tfrecord_dir, os.path.basename(self.tfrecord_dir)
      )
      self.expected_images = expected_images
      self.cur_images = 0
      self.shape = None
      self.resolution_log2 = None
      self.tfr_writers = []
      self.print_progress = print_progress
      self.progress_interval = progress_interval
  
      if self.print_progress:
          print('Creating dataset "%s"' % tfrecord_dir)
      if not os.path.isdir(self.tfrecord_dir):
          os.makedirs(self.tfrecord_dir)
      assert os.path.isdir(self.tfrecord_dir)
  
imports: import os
  import sys
  import glob
  import argparse
  import threading
  import six.moves.queue
  import traceback
  import numpy
  import tensorflow
  import PIL.Image
  import dnnlib.tflib
  from training import dataset
label_desc: Use image node_id 1 to create a new TFRecordExporter object  with example: obj = TFRecordExporter(tfrecord_dir, expected_images, print_progress, progress_interval)