code: def create_patch_slice(
      patch_size: Union[int, Sequence[int]], coords: Sequence[int]
  ) -> Tuple[slice, ...]:
      """
      Create a patch slice from patch size and coordinates.
  
      Parameters
      ----------
      patch_size: int, sequence
          One- or multidimensional patch size.
      coords: sequence
          Coordinates for creating patches.
  
      Returns
      -------
      tuple
          Patches at all provided coordinates.
      """
  
      if isinstance(patch_size, int):
          patch_size = (patch_size,)
      if isinstance(coords, int):
          coords = (coords,)
  
      patch_size = np.array(patch_size)
      coords = tuple(coords)
  
      assert isinstance(patch_size, np.ndarray)
      if len(patch_size) == 1 and len(coords) != 1:
          patch_size = tuple(patch_size for _ in coords)
      elif patch_size.ndim != 1:
          raise ValueError(
              "patch_size has to be either a scalar or a 1D-sequence"
          )
      elif len(patch_size) != len(coords):
          raise ValueError(
              "patch_size sequence length does not match coords length"
              f" (len(patch_size) != len(coords))"
          )
      # make sure that each element in tuple is integer
      patch_size = tuple(
          int(patch_size_dim) for patch_size_dim in patch_size
      )
  
      patch_slice = [
          slice(coord, coord + patch_size_dim)
          for coord, patch_size_dim in zip(coords, patch_size)
      ]
  
      return tuple(patch_slice)
  
imports: import copy
  import re
  from importlib import util
  from typing import Any, Dict, Optional, Sequence, Tuple, Union, List, TypeVar
  import numpy
  from skimage.segmentation import slic, felzenszwalb
  from quantus.helpers import asserts
  from quantus.helpers.model.model_interface import ModelInterface
label_desc: Use image node_id 12 for calling a global function with example usage: create_patch_slice(patch_size, coords) and returns: tuple