code: def get_rotation_y_v2(angle, is_mpi=False):
      # first get the rod matrix
      bs = angle.size(0)
      cos, sin = torch.cos(angle), torch.sin(angle)
      cos = (
          cos.repeat(3, 1)
          .view(3, bs)
          .permute(1, 0)
          .contiguous()
          .view(-1, 1)
      )
      sin = (
          sin.repeat(3, 1)
          .view(3, bs)
          .permute(1, 0)
          .contiguous()
          .view(-1, 1)
      )
      # if is_mpi:
      #     rx, ry, rz = -0.3189, 0.3282, 0.8891
      # else:
      rx, ry, rz = -0.01474, 0.96402, 0.261718
      # rx, ry, rz = 0, 1, 0
      r = torch.tensor([[rx, ry, rz]])
      r_mat = r.t().matmul(r)
      r_hat = torch.tensor([[0, -rz, ry], [rz, 0, -rx], [-ry, rx, 0]])
      e1 = cos * torch.eye(3).repeat(bs, 1).type_as(cos)
      e2 = (1 - cos) * r_mat.repeat(bs, 1).type_as(cos)
      e3 = sin * r_hat.repeat(bs, 1).type_as(sin)
      mat = e1 + e2 + e3
      mat = mat.view(bs, 3, 3)
      return mat
  
imports: import os
  import torch
  import torch.optim
  import numpy
  from sklearn.metrics import auc
label_desc: Use image node_id 3 for calling a global function with example usage: get_rotation_y_v2(angle, is_mpi) and returns: mat