code: def _get_city_pairs(folder, split="train"):
      def get_path_pairs(img_folder, mask_folder):
          """get image and mask path pair"""
          img_paths = []
          mask_paths = []
          for root, _, files in os.walk(img_folder):
              for filename in files:
                  if filename.endswith(".png"):
                      imgpath = os.path.join(root, filename)
                      foldername = os.path.basename(
                          os.path.dirname(imgpath)
                      )
                      maskname = filename.replace(
                          "leftImg8bit", "gtFine_labelIds"
                      )
                      maskpath = os.path.join(
                          mask_folder, foldername, maskname
                      )
                      if os.path.isfile(imgpath) and os.path.isfile(
                          maskpath
                      ):
                          img_paths.append(imgpath)
                          mask_paths.append(maskpath)
                      else:
                          print(
                              "cannot find the mask or image:",
                              imgpath,
                              maskpath,
                          )
          print(
              "Found {} images in the folder {}".format(
                  len(img_paths), img_folder
              )
          )
          return img_paths, mask_paths
  
      if split in ("train", "val"):
          img_folder = os.path.join(folder, "leftImg8bit/" + split)
          mask_folder = os.path.join(folder, "gtFine/" + split)
          img_paths, mask_paths = get_path_pairs(
              img_folder, mask_folder
          )
          return img_paths, mask_paths
      else:
          assert split == "trainval"
          print("trainval set")
          train_img_folder = os.path.join(folder, "leftImg8bit/train")
          train_mask_folder = os.path.join(folder, "gtFine/train")
          val_img_folder = os.path.join(folder, "leftImg8bit/val")
          val_mask_folder = os.path.join(folder, "gtFine/val")
          train_img_paths, train_mask_paths = get_path_pairs(
              train_img_folder, train_mask_folder
          )
          val_img_paths, val_mask_paths = get_path_pairs(
              val_img_folder, val_mask_folder
          )
          img_paths = train_img_paths + val_img_paths
          mask_paths = train_mask_paths + val_mask_paths
      return img_paths, mask_paths
  
file_path: gluon-cv/gluoncv/data/cityscapes.py
imports: import os
  import numpy
  from PIL import Image
  import mxnet
  from .segbase import SegmentationDataset
label_desc: Use image node_id 1 for calling a global function with example usage: _get_city_pairs(folder, split) and returns: img_paths,  mask_paths, img_paths,  mask_paths, img_paths,  mask_paths