code: def get_shear_matrix2d(
      center: Tensor,
      sx: Optional[Tensor] = None,
      sy: Optional[Tensor] = None,
  ) -> Tensor:
      r"""Compose shear matrix Bx4x4 from the components.
  
      Note: Ordered shearing, shear x-axis then y-axis.
  
      .. math::
          \begin{bmatrix}
              1 & b \\
              a & ab + 1 \\
          \end{bmatrix}
  
      Args:
          center: shearing center coordinates of (x, y).
          sx: shearing angle along x axis in radiants.
          sy: shearing angle along y axis in radiants
  
      Returns:
          params to be passed to the affine transformation with shape :math:`(B, 3, 3)`.
  
      Examples:
          >>> rng = torch.manual_seed(0)
          >>> sx = torch.randn(1)
          >>> sx
          tensor([1.5410])
          >>> center = torch.tensor([[0., 0.]])  # Bx2
          >>> get_shear_matrix2d(center, sx=sx)
          tensor([[[  1.0000, -33.5468,   0.0000],
                   [ -0.0000,   1.0000,   0.0000],
                   [  0.0000,   0.0000,   1.0000]]])
  
      .. note::
          This function is often used in conjunction with :func:`warp_affine`, :func:`warp_perspective`.
      """
      sx = tensor([0.0]).repeat(center.size(0)) if sx is None else sx
      sy = tensor([0.0]).repeat(center.size(0)) if sy is None else sy
  
      x, y = torch.split(center, 1, dim=-1)
      x, y = x.view(-1), y.view(-1)
  
      sx_tan = tan(sx)
      sy_tan = tan(sy)
      ones = ones_like(sx)
      shear_mat = stack(
          [
              ones,
              -sx_tan,
              sx_tan * y,
              -sy_tan,
              ones + sx_tan * sy_tan,
              sy_tan * (x - sx_tan * y),
          ],
          dim=-1,
      ).view(-1, 2, 3)
  
      shear_mat = convert_affinematrix_to_homography(shear_mat)
      return shear_mat
  
imports: from __future__ import annotations
  from typing import Optional
  import torch
  import torch.nn.functional
  from kornia.core import Tensor, concatenate, ones, ones_like, stack, tan, tensor, zeros
  from kornia.core.check import KORNIA_CHECK, KORNIA_CHECK_SHAPE
  from kornia.geometry.conversions import angle_to_rotation_matrix, axis_angle_to_rotation_matrix, convert_affinematrix_to_homography, convert_affinematrix_to_homography3d, deg2rad, normalize_homography, normalize_homography3d, normalize_pixel_coordinates
  from kornia.geometry.linalg import transform_points
  from kornia.utils import create_meshgrid, create_meshgrid3d, eye_like
  from kornia.utils.helpers import _torch_inverse_cast, _torch_solve_cast
label_desc: Use image node_id 12 for calling a global function with example usage: get_shear_matrix2d(center, sx, sy) and returns: shear_mat