code: def get_training_or_validation_split(
      samples, labels, validation_split, subset
  ):
      """Potentially restict samples & labels to a training or validation split.
  
      # Arguments
          samples: List of elements.
          labels: List of corresponding labels.
          validation_split: Float, fraction of data to reserve for validation.
          subset: Subset of the data to return.
              Either "training", "validation", or None.
              If None, we return all of the data.
  
      # Returns
          tuple (samples, labels), potentially restricted to the specified subset.
      """
      if not validation_split:
          return samples, labels
  
      num_val_samples = int(validation_split * len(samples))
      if subset == "training":
          print(
              "Using %d files for training."
              % (len(samples) - num_val_samples,)
          )
          samples = samples[:-num_val_samples]
          labels = labels[:-num_val_samples]
      elif subset == "validation":
          print("Using %d files for validation." % (num_val_samples,))
          samples = samples[-num_val_samples:]
          labels = labels[-num_val_samples:]
      else:
          raise ValueError(
              '`subset` must be either "training" '
              'or "validation", received: %s' % (subset,)
          )
      return samples, labels
  
file_path: autokeras/autokeras/utils/io_utils.py
imports: import json
  import multiprocessing
  import os
  from typing import Optional
  from typing import Tuple
  import numpy
  import tensorflow
  from keras_tuner.engine import hyperparameters
label_desc: Use image node_id 6 for calling a global function with example usage: get_training_or_validation_split(samples, labels, validation_split, subset) and returns: samples,  labels, samples,  labels