code: def _dataset(
      x, y=None, batch_size=128, num_epochs=1, shuffle=False, seed=None
  ):
      if y is None:
          dataset = tf.data.Dataset.from_tensor_slices(x)
      else:
          dataset = tf.data.Dataset.from_tensor_slices((x, y))
  
      if shuffle:
          dataset = dataset.shuffle(
              1000,
              seed=seed,
              reshuffle_each_iteration=True,  # buffer size = 1000
          )
      elif seed is not None:
          import warnings
  
          warnings.warn(
              "Seed was set but `shuffle=False`. Seed will be ignored."
          )
  
      return dataset.repeat(num_epochs).batch(batch_size)
  
imports: import itertools
  import numpy
  import tensorflow
  from tensorflow_estimator.python.estimator.export.export import build_supervised_input_receiver_fn_from_input_fn
label_desc: Use image node_id 3 for calling a global function with example usage: _dataset(x, y, batch_size, num_epochs, shuffle, seed) and returns: dataset