code: def transform_3d(inputs, rot_y, rot_x, is_reverse):
      # rot_y/rot_x: N x 1
      root3d = (
          inputs[:, 13:14].clone()
          if inputs.shape[1] == 17
          else inputs[:, 12:13]
      )
      outputs = inputs - root3d
      rot_y_mat = get_rotation_y_v2(rot_y)
      rot_x_mat = get_rotation_x(rot_x)
      rot_mat = (
          rot_x_mat.bmm(rot_y_mat)
          if not is_reverse
          else rot_y_mat.bmm(rot_x_mat)
      )
      # N x 3 x 3 , ((N x J x 3) -> (N x 3 x J)) -> N x 3 x J
      outputs = rot_mat.bmm(outputs.permute(0, 2, 1))
      outputs = outputs.permute(0, 2, 1)
      outputs += root3d
      return outputs
  
imports: import os
  import torch
  import torch.optim
  import numpy
  from sklearn.metrics import auc
label_desc: Use image node_id 10 for calling a global function with example usage: transform_3d(inputs, rot_y, rot_x, is_reverse) and returns: outputs