code: def get_transform(to_torch_tensor):
      # Note(swang): This is a different order from tf.data.
      # torch: decode -> randCrop+resize -> randFlip
      # tf.data: decode -> randCrop -> randFlip -> resize
      transform = torchvision.transforms.Compose(
          [
              torchvision.transforms.RandomResizedCrop(
                  antialias=True,
                  size=DEFAULT_IMAGE_SIZE,
                  scale=(0.05, 1.0),
                  ratio=(0.75, 1.33),
              ),
              torchvision.transforms.RandomHorizontalFlip(),
          ]
          + (
              [torchvision.transforms.ToTensor()]
              if to_torch_tensor
              else []
          )
          + [
              torchvision.transforms.Normalize(
                  mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]
              )
          ]
      )
      return transform
  
imports: import ray
  import torch
  import torchvision
  from torchvision.transforms.functional import pil_to_tensor
  import os
  import tensorflow
  import numpy
  from PIL import Image
  from typing import TYPE_CHECKING, Iterator, Callable, Any
  import pandas
  from benchmark import Benchmark
  import streaming
  from streaming import LocalDataset, StreamingDataset
  from ray.data._internal.delegating_block_builder import DelegatingBlockBuilder
label_desc: Use image node_id 6 for calling a global function with example usage: get_transform(to_torch_tensor) and returns: transform