code: def rotate(tens: Tensor, angle, rotPoint=None) -> Tensor:
      r"""
      Rotates an given image by an angle around a particular rotation point (if provided) or centre otherwise.
  
      """
      # h, w = image.shape[:2]
      # (cX, cY) = (w/2, h/2)
  
      # # Computing the sine and cosine (rotation components of the matrix)
      # transMat = cv.getRotationMatrix2D((cX, cY), angle, scale=1.0)
      # cos = np.abs(transMat[0, 0])
      # sin = np.abs(transMat[0, 1])
  
      # # compute the new bounding dimensions of the image
      # nW = int((h*sin) + (w*cos))
      # nH = int((h*cos) + (w*sin))
  
      # # Adjusts the rotation matrix to take into account translation
      # transMat[0, 2] += (nW/2) - cX
      # transMat[1, 2] += (nH/2) - cY
  
      # # Performs the actual rotation and returns the image
      # return cv.warpAffine(image, transMat, (nW, nH))
  
      height, width = tens.shape[:2]
  
      # If no rotPoint is specified, we assume the rotation point to be around the centre
      if rotPoint is None:
          rotPoint = (width // 2, height // 2)
  
      rotMat = cv.getRotationMatrix2D(rotPoint, angle, scale=1.0)
  
      tens = cv.warpAffine(tens, rotMat, (width, height))
      return to_tensor(tens, override_checks=True)
  
imports: import numpy
  import cv2
  import random
  import collections
  from ..coreten import Tensor, to_tensor
  from .._internal import _check_target_size
  from ..globals import INTER_AREA, INTER_CUBIC, INTER_NEAREST, INTER_LINEAR
  from ..annotations import Union, Tuple, Optional
label_desc: Use image node_id 9 for calling a global function with example usage: rotate(tens, angle, rotPoint) and returns: to_tensor