code: def euler_matrices(angles):
      """Computes a XYZ Tait-Bryan (improper Euler angle) rotation.
      Returns 4x4 matrices for convenient multiplication with other transformations.
      Args:
        angles: a [batch_size, 3] tensor containing X, Y, and Z angles in radians.
      Returns:
        a [batch_size, 4, 4] tensor of matrices.
      """
      s = np.sin(angles)
      c = np.cos(angles)
      # Rename variables for readability in the matrix definition below.
      c0, c1, c2 = (c[:, 0], c[:, 1], c[:, 2])
      s0, s1, s2 = (s[:, 0], s[:, 1], s[:, 2])
  
      zeros = np.zeros_like(s[:, 0])
      ones = np.ones_like(s[:, 0])
  
      # pyformat: disable
      flattened = np.concatenate(
          [
              c2 * c1,
              c2 * s1 * s0 - c0 * s2,
              s2 * s0 + c2 * c0 * s1,
              zeros,
              c1 * s2,
              c2 * c0 + s2 * s1 * s0,
              c0 * s2 * s1 - c2 * s0,
              zeros,
              -s1,
              c1 * s0,
              c1 * c0,
              zeros,
              zeros,
              zeros,
              zeros,
              ones,
          ],
          axis=0,
      )
      # pyformat: enable
      reshaped = np.reshape(flattened, [4, 4, -1])
      return np.transpose(reshaped, [2, 0, 1])
  
file_path: insightface/reconstruction/ostec/utils/ganfit_camera.py
imports: import numpy
  import math
label_desc: Use image node_id 3 for calling a global function with example usage: euler_matrices(angles) and returns: np