code: def flip_data(data):
      """
      horizontal flip
          data: [N, 17*k] or [N, 17, k], i.e. [x, y], [x, y, confidence] or [x, y, z]
      Return
          result: [2N, 17*k] or [2N, 17, k]
      """
      left_joints = [4, 5, 6, 11, 12, 13]
      right_joints = [1, 2, 3, 14, 15, 16]
  
      flipped_data = data.copy().reshape((len(data), 17, -1))
      flipped_data[:, :, 0] *= -1  # flip x of all joints
      flipped_data[:, left_joints + right_joints] = flipped_data[
          :, right_joints + left_joints
      ]
      flipped_data = flipped_data.reshape(data.shape)
  
      result = np.concatenate((data, flipped_data), axis=0)
  
      return result
  
file_path: TensorLayer/tensorlayer/app/human_pose_estimation/common.py
imports: import tensorflow
  import numpy
  import pickle
  import matplotlib.pyplot
  import os
  import matplotlib.gridspec
label_desc: Use image node_id 2 for calling a global function with example usage: flip_data(data) and returns: result