code: def _tfrecords_to_dataset(
      tfrecords: List[str],
      parallel_threads: int,
      shuffle: bool,
      repeat: bool,
      sloppy: bool,
      max_readers: int = 16,
  ) -> tf.data.TFRecordDataset:
      """Creates a TFRecordsDataset that iterates over filenames in parallel.
  
      Args:
        tfrecords: A list of tf.Data.TFRecords filenames.
        parallel_threads: The `int` number denoting number of parallel worker
          threads.
        shuffle: The `bool` flag denoting whether to shuffle the dataset.
        repeat: The `bool` flag denoting whether to repeat the dataset.
        sloppy: The `bool` flag denoting if elements are produced in deterministic
          order.
        max_readers: The `int` number denoting the maximum number of input tfrecords
          to interleave from in parallel.
  
      Returns:
        A tf.data.TFRecordDataset
      """
  
      total_tfrecords = sum(
          [len(tf.io.gfile.glob(f)) for f in tfrecords]
      )
      num_readers = min(total_tfrecords, max_readers)
      dataset = tf.data.Dataset.list_files(tfrecords, shuffle=shuffle)
      if repeat:
          dataset = dataset.repeat()
      return dataset.apply(
          tf.data.experimental.parallel_interleave(
              tf.data.TFRecordDataset,
              num_readers,
              sloppy=sloppy,
              buffer_output_elements=parallel_threads,
              prefetch_input_elements=parallel_threads,
          )
      )
  
file_path: graphics/tensorflow_graphics/notebooks/mesh_segmentation_dataio.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Any, Callable, Dict, List, Tuple
  import numpy
  import tensorflow
  from tensorflow_graphics.geometry.convolution import utils
  from tensorflow_graphics.geometry.representation.mesh import utils
  from tensorflow_graphics.util import shape
  from tensorflow_graphics.util import type_alias
label_desc: Use image node_id 3 for calling a global function with example usage: _tfrecords_to_dataset(tfrecords, parallel_threads, shuffle, repeat, sloppy, max_readers) and returns: dataset