code: def filter_3d_joints(pred, gt, has_3d_joints):
      """
      filter 3d joints
      """
      gt = gt[has_3d_joints == 1]
      gt = gt[:, :, :3]
      pred = pred[has_3d_joints == 1]
  
      gt_pelvis = (gt[:, 2, :] + gt[:, 3, :]) / 2
      gt = gt - gt_pelvis[:, None, :]
      pred_pelvis = (pred[:, 2, :] + pred[:, 3, :]) / 2
      pred = pred - pred_pelvis[:, None, :]
      return pred, gt
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from itertools import cycle, islice
  from collections import abc
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register, serializable
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 1 for calling a global function with example usage: filter_3d_joints(pred, gt, has_3d_joints) and returns: pred,  gt