code: def calc_auc_aligned(
      joints_3d_pre, joints_3d_gt, head_size=300, is_mpi=True
  ):
      joints_3d_pre = rigid_align(joints_3d_pre, joints_3d_gt)
      indices = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 16]
      # joints_3d_pre = joints_3d_pre[:, indices]
      # joints_3d_gt = joints_3d_gt[:, indices]
      dists = calc_dists(
          joints_3d_pre, joints_3d_gt, head_size=head_size
      )
      x = np.arange(0.0, 0.51, 0.05)
      pcks = []
      pckh5 = 0.0
      for thresh in x:
          pck = calc_pck3d(dists, thresh)
          if thresh == 0.50:
              pckh5 = pck
          pcks.append(pck)
      # scale to 0~1
      x = _scale_range(x, 0, 1)
      auc_val = auc(x, np.array(pcks))
      # the second output is the pckh@0.5
      return auc_val, pckh5
  
imports: import os
  import torch
  import torch.optim
  import numpy
  from sklearn.metrics import auc
label_desc: Use image node_id 25 for calling a global function with example usage: calc_auc_aligned(joints_3d_pre, joints_3d_gt, head_size, is_mpi) and returns: auc_val,  pckh5