code: def generate_one_hot_labels(
      num_instances=100, num_classes=10, dtype="np"
  ):
      np.random.seed(SEED)
      labels = np.random.randint(num_classes, size=num_instances)
      data = keras.utils.to_categorical(labels, num_classes=num_classes)
      if dtype == "np":
          return data
      if dtype == "dataset":
          return tf.data.Dataset.from_tensor_slices(data).batch(32)
  
file_path: autokeras/autokeras/test_utils.py
imports: import inspect
  import os
  import numpy
  import tensorflow
  from tensorflow import keras
  import autokeras
label_desc: Use image node_id 2 for calling a global function with example usage: generate_one_hot_labels(num_instances, num_classes, dtype) and returns: data, tf