code: def build_tfrecords_tf_dataset(data_root, batch_size):
      filenames = [
          os.path.join(data_root, pathname)
          for pathname in os.listdir(data_root)
      ]
      ds = tf.data.Dataset.from_tensor_slices(filenames)
      ds = ds.interleave(tf.data.TFRecordDataset).map(
          parse_and_decode_tfrecord,
          num_parallel_calls=tf.data.experimental.AUTOTUNE,
      )
      ds = ds.map(lambda img, label: (tf_crop_and_flip(img), label))
      ds = ds.batch(batch_size)
      return ds
  
imports: import ray
  import torch
  import torchvision
  from torchvision.transforms.functional import pil_to_tensor
  import os
  import tensorflow
  import numpy
  from PIL import Image
  from typing import TYPE_CHECKING, Iterator, Callable, Any
  import pandas
  from benchmark import Benchmark
  import streaming
  from streaming import LocalDataset, StreamingDataset
  from ray.data._internal.delegating_block_builder import DelegatingBlockBuilder
label_desc: Use image node_id 4 for calling a global function with example usage: build_tfrecords_tf_dataset(data_root, batch_size) and returns: ds