code: def test_recognition_dataset(
      mock_image_folder, mock_recognition_label
  ):
      input_size = (32, 128)
      ds = datasets.RecognitionDataset(
          img_folder=mock_image_folder,
          labels_path=mock_recognition_label,
          img_transforms=Resize(input_size, preserve_aspect_ratio=True),
      )
      assert len(ds) == 5
      image, label = ds[0]
      assert isinstance(image, tf.Tensor)
      assert image.shape[:2] == input_size
      assert image.dtype == tf.float32
      assert isinstance(label, str)
  
      loader = DataLoader(ds, batch_size=2)
      images, labels = next(iter(loader))
      assert isinstance(images, tf.Tensor) and images.shape == (
          2,
          *input_size,
          3,
      )
      assert isinstance(labels, list) and all(
          isinstance(elt, str) for elt in labels
      )
  
      # File existence check
      img_name, _ = ds.data[0]
      move(
          os.path.join(ds.root, img_name),
          os.path.join(ds.root, "tmp_file"),
      )
      with pytest.raises(FileNotFoundError):
          datasets.RecognitionDataset(
              mock_image_folder, mock_recognition_label
          )
      move(
          os.path.join(ds.root, "tmp_file"),
          os.path.join(ds.root, img_name),
      )
  
imports: import os
  from shutil import move
  import numpy
  import pytest
  import tensorflow
  from doctr import datasets
  from doctr.datasets import DataLoader
  from doctr.file_utils import CLASS_NAME
  from doctr.transforms import Resize
label_desc: Use image node_id 5 for calling a global function with example usage: test_recognition_dataset(mock_image_folder, mock_recognition_label) without return types