code: def grid_pull(
      input: torch.Tensor,
      grid: torch.Tensor,
      interpolation="linear",
      bound="zero",
      extrapolate: bool = True,
  ) -> torch.Tensor:
      """
      Sample an image with respect to a deformation field.
  
      `interpolation` can be an int, a string or an InterpolationType.
      Possible values are::
  
          - 0 or 'nearest'    or InterpolationType.nearest
          - 1 or 'linear'     or InterpolationType.linear
          - 2 or 'quadratic'  or InterpolationType.quadratic
          - 3 or 'cubic'      or InterpolationType.cubic
          - 4 or 'fourth'     or InterpolationType.fourth
          - 5 or 'fifth'      or InterpolationType.fifth
          - 6 or 'sixth'      or InterpolationType.sixth
          - 7 or 'seventh'    or InterpolationType.seventh
  
      A list of values can be provided, in the order [W, H, D],
      to specify dimension-specific interpolation orders.
  
      `bound` can be an int, a string or a BoundType.
      Possible values are::
  
          - 0 or 'replicate' or 'nearest'      or BoundType.replicate or 'border'
          - 1 or 'dct1'      or 'mirror'       or BoundType.dct1
          - 2 or 'dct2'      or 'reflect'      or BoundType.dct2
          - 3 or 'dst1'      or 'antimirror'   or BoundType.dst1
          - 4 or 'dst2'      or 'antireflect'  or BoundType.dst2
          - 5 or 'dft'       or 'wrap'         or BoundType.dft
          - 7 or 'zero'      or 'zeros'        or BoundType.zero
  
      A list of values can be provided, in the order [W, H, D],
      to specify dimension-specific boundary conditions.
      `sliding` is a specific condition than only applies to flow fields
      (with as many channels as dimensions). It cannot be dimension-specific.
      Note that:
  
          - `dft` corresponds to circular padding
          - `dct2` corresponds to Neumann boundary conditions (symmetric)
          - `dst2` corresponds to Dirichlet boundary conditions (antisymmetric)
  
      See Also:
          - https://en.wikipedia.org/wiki/Discrete_cosine_transform
          - https://en.wikipedia.org/wiki/Discrete_sine_transform
          - ``help(monai._C.BoundType)``
          - ``help(monai._C.InterpolationType)``
  
      Args:
          input: Input image. `(B, C, Wi, Hi, Di)`.
          grid: Deformation field. `(B, Wo, Ho, Do, 1|2|3)`.
          interpolation (int or list[int] , optional): Interpolation order.
              Defaults to `'linear'`.
          bound (BoundType, or list[BoundType], optional): Boundary conditions.
              Defaults to `'zero'`.
          extrapolate: Extrapolate out-of-bound data.
              Defaults to `True`.
  
      Returns:
          output (torch.Tensor): Deformed image `(B, C, Wo, Ho, Do)`.
  
      """
      # Convert parameters
      bound = [
          _C.BoundType.__members__[b]
          if isinstance(b, str)
          else _C.BoundType(b)
          for b in ensure_tuple(bound)
      ]
      interpolation = [
          _C.InterpolationType.__members__[i]
          if isinstance(i, str)
          else _C.InterpolationType(i)
          for i in ensure_tuple(interpolation)
      ]
      out: torch.Tensor
      out = _GridPull.apply(
          input, grid, interpolation, bound, extrapolate
      )
      if isinstance(input, monai.data.MetaTensor):
          out = convert_to_dst_type(out, dst=input)[0]
      return out
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  import torch
  import torch.nn
  import monai
  from monai.networks import to_norm_affine
  from monai.utils import GridSampleMode, GridSamplePadMode, convert_to_dst_type, ensure_tuple, look_up_option, optional_import
label_desc: Use image node_id 1 for calling a global function with example usage: grid_pull(input, grid, interpolation, bound, extrapolate) and returns: out