code: def mean_per_joint_position_error(pred, gt, has_3d_joints):
      """
      Compute mPJPE
      """
      gt = gt[has_3d_joints == 1]
      gt = gt[:, :, :3]
      pred = pred[has_3d_joints == 1]
  
      with paddle.no_grad():
          gt_pelvis = (gt[:, 2, :] + gt[:, 3, :]) / 2
          gt = gt - gt_pelvis[:, None, :]
          pred_pelvis = (pred[:, 2, :] + pred[:, 3, :]) / 2
          pred = pred - pred_pelvis[:, None, :]
          error = (
              paddle.sqrt(((pred - gt) ** 2).sum(axis=-1))
              .mean(axis=-1)
              .numpy()
          )
          return error
  
imports: import paddle
  from paddle.distributed import ParallelEnv
  import os
  import json
  from collections import defaultdict, OrderedDict
  import numpy
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 1 for calling a global function with example usage: mean_per_joint_position_error(pred, gt, has_3d_joints) and returns: error