code: def cut_patches(
      input: torch.Tensor,
      indices: Tuple[Tuple[int, int]],
      patch_size: int,
      padding: int = 0,
  ):
      # TODO use slices to get all patches at the same time ?
  
      patches_l = []
      for n in range(len(indices)):
          patch = F.crop(
              input,
              *(indices[n] - padding),
              *(patch_size + padding * 2,) * 2,
          )
          patches_l.append(patch)
      patches = torch.cat(patches_l, dim=0)
  
      return patches
  
imports: from typing import Callable, Dict
  import torch
  from torch.utils.data import Dataset
  import torchvision.transforms.functional
  from torchvision import transforms
  import pytorch_lightning
  from collections.abc import Iterable
  from pathlib import Path
  from PIL import Image
  from typing import Tuple
label_desc: Use image node_id 6 for calling a global function with example usage: cut_patches(input, indices, patch_size, padding) and returns: patches