code: def get_matrix(transform):
      """
      Creates matrix from carla transform.
      """
  
      rotation = transform.rotation
      location = transform.location
      c_y = np.cos(np.radians(rotation.yaw))
      s_y = np.sin(np.radians(rotation.yaw))
      c_r = np.cos(np.radians(rotation.roll))
      s_r = np.sin(np.radians(rotation.roll))
      c_p = np.cos(np.radians(rotation.pitch))
      s_p = np.sin(np.radians(rotation.pitch))
      matrix = np.matrix(np.identity(4))
      matrix[0, 3] = location.x
      matrix[1, 3] = location.y
      matrix[2, 3] = location.z
      matrix[0, 0] = c_p * c_y
      matrix[0, 1] = c_y * s_p * s_r - s_y * c_r
      matrix[0, 2] = -c_y * s_p * c_r - s_y * s_r
      matrix[1, 0] = s_y * c_p
      matrix[1, 1] = s_y * s_p * s_r + c_y * c_r
      matrix[1, 2] = -s_y * s_p * c_r + c_y * s_r
      matrix[2, 0] = s_p
      matrix[2, 1] = -c_p * s_r
      matrix[2, 2] = c_p * c_r
      return matrix
  
imports: import glob
  import os
  import sys
  from enum import Enum
  import math
  import numpy
  import pygame
  import weakref
  import carla
  from carla import ad
label_desc: Use image node_id 1 for calling a global function with example usage: get_matrix(transform) and returns: matrix