code: def get_paths(lfw_dir, pairs, file_ext):
      nrof_skipped_pairs = 0
      path_list = []
      issame_list = []
      for pair in pairs:
          if len(pair) == 3:
              path0 = os.path.join(
                  lfw_dir,
                  pair[0],
                  pair[0]
                  + "_"
                  + "%04d" % int(pair[1])
                  + "."
                  + file_ext,
              )
              path1 = os.path.join(
                  lfw_dir,
                  pair[0],
                  pair[0]
                  + "_"
                  + "%04d" % int(pair[2])
                  + "."
                  + file_ext,
              )
              issame = True
          elif len(pair) == 4:
              path0 = os.path.join(
                  lfw_dir,
                  pair[0],
                  pair[0]
                  + "_"
                  + "%04d" % int(pair[1])
                  + "."
                  + file_ext,
              )
              path1 = os.path.join(
                  lfw_dir,
                  pair[2],
                  pair[2]
                  + "_"
                  + "%04d" % int(pair[3])
                  + "."
                  + file_ext,
              )
              issame = False
          if os.path.exists(path0) and os.path.exists(
              path1
          ):  # Only add the pair if both paths exist
              path_list += (path0, path1)
              issame_list.append(issame)
          else:
              print("not exists", path0, path1)
              nrof_skipped_pairs += 1
      if nrof_skipped_pairs > 0:
          print("Skipped %d image pairs" % nrof_skipped_pairs)
  
      return path_list, issame_list
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import numpy
  from scipy import misc
  from sklearn.model_selection import KFold
  from scipy import interpolate
  import sklearn
  from sklearn.decomposition import PCA
  import mxnet
  from mxnet import ndarray
label_desc: Use image node_id 6 for calling a global function with example usage: get_paths(lfw_dir, pairs, file_ext) and returns: path_list,  issame_list