code: def test_ocrdataset(mock_ocrdataset, use_polygons):
      input_size = (512, 512)
  
      ds = datasets.OCRDataset(
          *mock_ocrdataset,
          img_transforms=Resize(input_size),
          use_polygons=use_polygons,
      )
  
      assert len(ds) == 3
      _validate_dataset(ds, input_size, is_polygons=use_polygons)
  
      # 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.OCRDataset(*mock_ocrdataset)
      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 torch
  from torch.utils.data import DataLoader, RandomSampler
  from doctr import datasets
  from doctr.file_utils import CLASS_NAME
  from doctr.transforms import Resize
label_desc: Use image node_id 6 for calling a global function with example usage: test_ocrdataset(mock_ocrdataset, use_polygons) without return types