code: def check_matrix_shape(
      matrix: Tensor, matrix_type: str = "R"
  ) -> None:
      target_shapes = []
      if matrix_type == "R":
          target_shapes = [[2, 2], [3, 3]]
      elif matrix_type == "RT":
          target_shapes = [[3, 3], [4, 4]]
      if (
          len(matrix.shape) > 3
          or len(matrix.shape) < 2
          or list(matrix.shape[-2:]) not in target_shapes
      ):
          raise ValueError(
              f"{matrix_type} must be either {target_shapes[0]}x{target_shapes[0]} or \
                {target_shapes[1]}x{target_shapes[1]}, got {matrix.shape}"
          )
  
file_path: kornia/kornia/geometry/pose.py
imports: from __future__ import annotations
  import uuid
  from kornia.core import Tensor, eye
  from kornia.geometry.liegroup import Se2, Se3, So2, So3
  from kornia.geometry.quaternion import Quaternion
label_desc: Use image node_id 1 for calling a global function with example usage: check_matrix_shape(matrix, matrix_type) without return types