code: def get_dataset(
      tfrecords_pattern,
      mapping_func,
      buffer_size=500,
      shuffle=True,
      cycle_length=16,
  ):
      """Generates a TF Dataset from a rio pattern."""
      with tf.name_scope("Input/"):
          tfrecords_pattern = expand_rio_pattern(tfrecords_pattern)
          dataset = tf.data.Dataset.list_files(
              tfrecords_pattern, shuffle=shuffle
          )
          dataset = dataset.interleave(
              tf.data.TFRecordDataset, cycle_length=cycle_length
          )
          # for d in dataset.take(1):
          #   mapping_func(d)
          if shuffle:
              dataset = dataset.shuffle(buffer_size=buffer_size)
          dataset = dataset.map(mapping_func)
          return dataset
  
imports: import re
  import tensorflow
label_desc: Use image node_id 3 for calling a global function with example usage: get_dataset(tfrecords_pattern, mapping_func, buffer_size, shuffle, cycle_length) and returns: dataset