code: def create_keypoint_hflip_indices(
      dataset_names: Union[str, List[str]]
  ) -> List[int]:
      """
      Args:
          dataset_names: list of dataset names
  
      Returns:
          list[int]: a list of size=#keypoints, storing the
          horizontally-flipped keypoint indices.
      """
      if isinstance(dataset_names, str):
          dataset_names = [dataset_names]
  
      check_metadata_consistency("keypoint_names", dataset_names)
      check_metadata_consistency("keypoint_flip_map", dataset_names)
  
      meta = MetadataCatalog.get(dataset_names[0])
      names = meta.keypoint_names
      # TODO flip -> hflip
      flip_map = dict(meta.keypoint_flip_map)
      flip_map.update({v: k for k, v in flip_map.items()})
      flipped_names = [
          i if i not in flip_map else flip_map[i] for i in names
      ]
      flip_indices = [names.index(i) for i in flipped_names]
      return flip_indices
  
imports: import logging
  import numpy
  from typing import List, Union
  import pycocotools.mask
  import torch
  from PIL import Image
  from detectron2.structures import BitMasks, Boxes, BoxMode, Instances, Keypoints, PolygonMasks, RotatedBoxes, polygons_to_bitmask
  from detectron2.utils.file_io import PathManager
  from .None import transforms
  from .catalog import MetadataCatalog
label_desc: Use image node_id 13 for calling a global function with example usage: create_keypoint_hflip_indices(dataset_names) and returns: flip_indices