code: def tfrecords_to_dataset(
      tfrecords_pattern, mapping_func, batch_size, buffer_size=5000
  ):
      """Generates a TF Dataset from a rio pattern."""
      with tf.name_scope("Input/"):
          tfrecords_pattern = _expand_tfrecords_pattern(
              tfrecords_pattern
          )
          dataset = tf.data.Dataset.list_files(
              tfrecords_pattern, shuffle=True
          )
          dataset = dataset.interleave(
              tf.data.TFRecordDataset, cycle_length=16
          )
          dataset = dataset.shuffle(buffer_size=buffer_size)
          dataset = dataset.map(mapping_func)
          dataset = dataset.batch(batch_size)
          return dataset
  
file_path: graphics/tensorflow_graphics/projects/neural_voxel_renderer/prepare_tfrecords/generate_tfrecords_nvr_plus.py
imports: import os
  import re
  from absl import app
  from absl import flags
  import numpy
  import tensorflow
  from tensorflow_graphics.projects.neural_voxel_renderer import helpers
  from tensorflow_graphics.projects.neural_voxel_renderer.prepare_tfrecords import data_pb2
label_desc: Use image node_id 4 for calling a global function with example usage: tfrecords_to_dataset(tfrecords_pattern, mapping_func, batch_size, buffer_size) and returns: dataset