code: def crop(
      img: Tensor, top: int, left: int, height: int, width: int
  ) -> Tensor:
      _assert_image_tensor(img)
  
      _, h, w = get_dimensions(img)
      right = left + width
      bottom = top + height
  
      if left < 0 or top < 0 or right > w or bottom > h:
          padding_ltrb = [
              max(-left + min(0, right), 0),
              max(-top + min(0, bottom), 0),
              max(right - max(w, left), 0),
              max(bottom - max(h, top), 0),
          ]
          return pad(
              img[..., max(top, 0) : bottom, max(left, 0) : right],
              padding_ltrb,
              fill=0,
          )
      return img[..., top:bottom, left:right]
  
imports: import warnings
  from typing import List, Optional, Tuple, Union
  import torch
  from torch import Tensor
  from torch.nn.functional import conv2d, grid_sample, interpolate, pad
label_desc: Use image node_id 11 for calling a global function with example usage: crop(img, top, left, height, width) and returns: img, pad