code: def angle2matrix_3ddfa(angles):
      """get rotation matrix from three rotation angles(radian). The same as in 3DDFA.
      Args:
          angles: [3,]. x, y, z angles
          x: pitch.
          y: yaw.
          z: roll.
      Returns:
          R: 3x3. rotation matrix.
      """
      # x, y, z = np.deg2rad(angles[0]), np.deg2rad(angles[1]), np.deg2rad(angles[2])
      x, y, z = angles[0], angles[1], 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 = Rx.dot(Ry).dot(Rz)
      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 2 for calling a global function with example usage: angle2matrix_3ddfa(angles) and returns: R