code: def _make_dataset(dir):
      dir = os.path.expanduser(dir)
      if not os.path.isdir(dir):
          raise ("{} should be a dir".format(dir))
      images = []
      for root, _, fnames in sorted(os.walk(dir, followlinks=True)):
          for fname in sorted(fnames):
              path = os.path.join(root, fname)
              if _is_valid_file(path):
                  images.append(path)
      return images
  
imports: import os
  import copy
  import numpy
  from paddle.io import Dataset
  from ppdet.core.workspace import register, serializable
  from ppdet.utils.download import get_dataset_path
  from ppdet.data import source
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 2 for calling a global function with example usage: _make_dataset(dir) and returns: images