code: def apply_transform_without_normalize(
      image: Image.Image,
      transform,
  ):
      """Applies the transform to the image but skips ToTensor and Normalize."""
      skippable_transforms = (
          torchvision.transforms.ToTensor,
          torchvision.transforms.Normalize,
      )
      if isinstance(transform, torchvision.transforms.Compose):
          for transform_ in transform.transforms:
              image = apply_transform_without_normalize(
                  image, transform_
              )
      elif not isinstance(transform, skippable_transforms):
          image = transform(image)
      return image
  
file_path: lightly/lightly/utils/debug.py
imports: from typing import List, Union
  import torch
  import torchvision
  from PIL import Image
  from lightly.data.collate import BaseCollateFunction, MultiViewCollateFunction
label_desc: Use image node_id 3 for calling a global function with example usage: apply_transform_without_normalize(image, transform) and returns: image