code: def load_dataset(config: CfgNode, return_class=True, test=False):
      r"""A plm loader using a global config.
      It will load the train, valid, and test set (if exists) simulatenously.
  
      Args:
          config (:obj:`CfgNode`): The global config from the CfgNode.
          return_class (:obj:`bool`): Whether return the data processor class
                      for future usage.
  
      Returns:
          :obj:`Optional[List[InputExample]]`: The train dataset.
          :obj:`Optional[List[InputExample]]`: The valid dataset.
          :obj:`Optional[List[InputExample]]`: The test dataset.
          :obj:"
      """
      dataset_config = config.dataset
  
      processor = PROCESSORS[dataset_config.name.lower()]()
  
      train_dataset = None
      valid_dataset = None
      if not test:
          try:
              train_dataset = processor.get_train_examples(
                  dataset_config.path
              )
          except FileNotFoundError:
              logger.warning(
                  f"Has no training dataset in {dataset_config.path}."
              )
          try:
              valid_dataset = processor.get_dev_examples(
                  dataset_config.path
              )
          except FileNotFoundError:
              logger.warning(
                  f"Has no validation dataset in {dataset_config.path}."
              )
  
      test_dataset = None
      try:
          test_dataset = processor.get_test_examples(
              dataset_config.path
          )
      except FileNotFoundError:
          logger.warning(
              f"Has no test dataset in {dataset_config.path}."
          )
      # checking whether downloaded.
      if (
          (train_dataset is None)
          and (valid_dataset is None)
          and (test_dataset is None)
      ):
          logger.error(
              "Dataset is empty. Either there is no download or the path is wrong. "
              + "If not downloaded, please `cd datasets/` and `bash download_xxx.sh`"
          )
          exit()
      if return_class:
          return train_dataset, valid_dataset, test_dataset, processor
      else:
          return train_dataset, valid_dataset, test_dataset
  
file_path: OpenPrompt/openprompt/data_utils/__init__.py
imports: from yacs.config import CfgNode
  from .typing_dataset import PROCESSORS
  from .text_classification_dataset import PROCESSORS
  from .fewglue_dataset import PROCESSORS
  from .relation_classification_dataset import PROCESSORS
  from .lama_dataset import PROCESSORS
  from .conditional_generation_dataset import PROCESSORS
  from .utils import InputExample, InputFeatures
  from .data_sampler import FewShotSampler
  from .nli_dataset import PROCESSORS
  from openprompt.utils.logging import logger
  from openprompt.data_utils.huggingface_dataset import PROCESSORS
label_desc: Use image node_id 1 for calling a global function with example usage: load_dataset(config, return_class, test) and returns: train_dataset,  valid_dataset,  test_dataset,  processor, train_dataset,  valid_dataset,  test_dataset