code: def _get_paths_from_images(path):
      assert os.path.isdir(
          path
      ), "{:s} is not a valid directory".format(path)
      images = []
      for dirpath, _, fnames in sorted(os.walk(path)):
          for fname in sorted(fnames):
              if is_image_file(fname):
                  img_path = os.path.join(dirpath, fname)
                  images.append(img_path)
      assert images, "{:s} has no valid image file".format(path)
      return images
  
imports: import os
  import math
  import random
  import numpy
  import torch
  import cv2
  from torchvision.utils import make_grid
  from datetime import datetime
label_desc: Use image node_id 6 for calling a global function with example usage: _get_paths_from_images(path) and returns: images