code: def flip_heatmap(heatmap, joint_pairs, shift=False):
      """Flip pose heatmap according to joint pairs.
  
      Parameters
      ----------
      heatmap : numpy.ndarray
          Heatmap of joints.
      joint_pairs : list
          List of joint pairs
      shift : bool
          Whether to shift the output
  
      Returns
      -------
      numpy.ndarray
          Flipped heatmap
  
      """
      assert (
          heatmap.ndim == 3
      ), "heatmap should have shape (num_joints, height, width)"
      out = heatmap[:, :, ::-1]
  
      for pair in joint_pairs:
          tmp = out[pair[0], :, :].copy()
          out[pair[0], :, :] = out[pair[1], :, :]
          out[pair[1], :, :] = tmp
  
      if shift:
          out[:, :, 1:] = out[:, :, 0:-1]
      return out
  
file_path: gluon-cv/gluoncv/data/transforms/presets/alpha_pose.py
imports: from __future__ import absolute_import
  import random
  import numpy
  import mxnet
  from ..pose import random_sample_bbox, count_visible, random_crop_bbox
  from ..pose import drawGaussian, transformBox, cv_cropBox, cv_rotate, detector_to_alpha_pose
label_desc: Use image node_id 1 for calling a global function with example usage: flip_heatmap(heatmap, joint_pairs, shift) and returns: out