code: def angle2matrix(angles):
      """get rotation matrix from three rotation angles(degree). right-handed.
      Args:
          angles: [3,]. x, y, z angles
          x: pitch. positive for looking down.
          y: yaw. positive for looking left.
          z: roll. positive for tilting head right.
      Returns:
          R: [3, 3]. rotation matrix.
      """
      x, y, z = (
          np.deg2rad(angles[0]),
          np.deg2rad(angles[1]),
          np.deg2rad(angles[2]),
      )
      # x
      Rx = np.array(
          [[1, 0, 0], [0, cos(x), -sin(x)], [0, sin(x), cos(x)]]
      )
      # y
      Ry = np.array(
          [[cos(y), 0, sin(y)], [0, 1, 0], [-sin(y), 0, cos(y)]]
      )
      # z
      Rz = np.array(
          [[cos(z), -sin(z), 0], [sin(z), cos(z), 0], [0, 0, 1]]
      )
  
      R = Rz.dot(Ry.dot(Rx))
      return R.astype(np.float32)
  
file_path: insightface/python-package/insightface/thirdparty/face3d/mesh/transform.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import math
  from math import cos, sin
label_desc: Use image node_id 1 for calling a global function with example usage: angle2matrix(angles) and returns: R