code: def test_from_data(data, from_function):
      img_data = from_function(
          train_data=data,
          train_targets=[0, 3, 6],
          val_data=data,
          val_targets=[1, 4, 7],
          test_data=data,
          test_targets=[2, 5, 8],
          batch_size=2,
          num_workers=0,
      )
  
      # check training data
      data = next(iter(img_data.train_dataloader()))
      imgs, labels = data["input"], data["target"]
      assert imgs.shape == (2, 3, 128, 128)
      assert labels.shape == (2,)
      assert labels.numpy()[0] in [0, 3, 6]  # data comes shuffled here
      assert labels.numpy()[1] in [0, 3, 6]  # data comes shuffled here
  
      # check validation data
      data = next(iter(img_data.val_dataloader()))
      imgs, labels = data["input"], data["target"]
      assert imgs.shape == (2, 3, 128, 128)
      assert labels.shape == (2,)
      assert list(labels.numpy()) == [1, 4]
  
      # check test data
      data = next(iter(img_data.test_dataloader()))
      imgs, labels = data["input"], data["target"]
      assert imgs.shape == (2, 3, 128, 128)
      assert labels.shape == (2,)
      assert list(labels.numpy()) == [2, 5]
  
imports: from pathlib import Path
  from typing import Tuple
  import flash
  import numpy
  import pytest
  import torch
  from flash.audio import AudioClassificationData
  from flash.core.utilities.imports import _MATPLOTLIB_AVAILABLE, _PIL_AVAILABLE, _TOPIC_AUDIO_AVAILABLE
  from pytorch_lightning import seed_everything
label_desc: Use image node_id 5 for calling a global function with example usage: test_from_data(data, from_function) without return types