code: def load_dataset(
      class_name=None, data_dir=None, verbose=False, **kwargs
  ):
      kwargs = dict(kwargs)
      if "tfrecord_dir" in kwargs:
          if class_name is None:
              class_name = __name__ + ".TFRecordDataset"
          if data_dir is not None:
              kwargs["tfrecord_dir"] = os.path.join(
                  data_dir, kwargs["tfrecord_dir"]
              )
  
      assert class_name is not None
      if verbose:
          print("Streaming data using %s..." % class_name)
      dataset = dnnlib.util.get_obj_by_name(class_name)(**kwargs)
      if verbose:
          print("Dataset shape =", np.int32(dataset.shape).tolist())
          print("Dynamic range =", dataset.dynamic_range)
          print("Label size    =", dataset.label_size)
      return dataset
  
file_path: insightface/reconstruction/ostec/external/stylegan2/training/dataset.py
imports: import os
  import glob
  import numpy
  import tensorflow
  import dnnlib
  import dnnlib.tflib
label_desc: Use image node_id 1 for calling a global function with example usage: load_dataset(class_name, data_dir, verbose) and returns: dataset