code: def train_valid_test_datasets_provider(train_val_test_num_samples):
      """Build train, valid, and test datasets."""
      args = get_args()
  
      print_rank_0(
          "> building train, validation, and test datasets "
          "for GPT ..."
      )
      train_ds, _, test_ds = BlendedMegatronDatasetBuilder(
          GPTDataset,
          train_val_test_num_samples,
          GPTDatasetConfig(
              blend=args.data_path,
              split=args.split,
              random_seed=args.seed,
              sequence_length=args.seq_length,
              path_to_cache=args.data_cache_path,
              return_document_ids=False,
          ),
      ).build()
      print_rank_0("> finished creating finetuning GPT datasets ...")
  
      _, valid_ds, _ = BlendedMegatronDatasetBuilder(
          GPTDataset,
          train_val_test_num_samples,
          GPTDatasetConfig(
              blend=args.data_path2,
              split="98,2,0",
              random_seed=1234,
              sequence_length=2048,
              path_to_cache=args.data_cache_path,
              return_document_ids=False,
          ),
      ).build()
      print_rank_0("> finished creating pretrained GPT datasets ...")
  
      return train_ds, valid_ds, test_ds
  
imports: import torch
  from functools import partial
  import os
  import sys
  from megatron import get_args
  from megatron import get_timers
  from megatron import get_tokenizer
  from megatron import print_rank_0
  from megatron.core import mpu
  from megatron.core.datasets.blended_megatron_dataset_builder import BlendedMegatronDatasetBuilder
  from megatron.core.datasets.blended_megatron_dataset_config import GPTDatasetConfig
  from megatron.core.datasets.gpt_dataset import GPTDataset
  from megatron.model import GPTModel
  from megatron.core.enums import ModelType
  from megatron.training import pretrain
  from megatron.utils import get_ltor_masks_and_position_ids
  from megatron.utils import average_losses_across_data_parallel_group
label_desc: Use image node_id 5 for calling a global function with example usage: train_valid_test_datasets_provider(train_val_test_num_samples) and returns: train_ds,  valid_ds,  test_ds