code: def to_torch(
      data,
      resize: int = None,
      crop: int = None,
      mean: List = None,
      std: List = None,
  ) -> Union[Dataset, None]:
      """Convert data from any format to torch datasets."""
  
      # Handle empty dataset.
      if data is None:
          return None
  
      # Recognize data format and convert accordingly.
      data_format = recognize_data_format(data)
      if data_format == "pytorch-dataset":
          # TODO: Maybe apply transformations to torch dataset as well.
          return data
      elif data_format == "numpy":
          return numpy_to_torch(
              data, resize=resize, crop=crop, mean=mean, std=std
          )
      elif data_format == "files":
          return files_to_torch(
              data, resize=resize, crop=crop, mean=mean, std=std
          )
      else:
          raise RuntimeError()
  
imports: import numpy
  import torch
  from torch.utils.data import Dataset
  from torchvision import datasets, transforms
  from typing import List, Union
  from pathlib import Path
  from PIL import Image
label_desc: Use image node_id 5 for calling a global function with example usage: to_torch(data, resize, crop, mean, std) and returns: None, data, numpy_to_torch, files_to_torch