code: def train_valid_test_datasets_provider(train_val_test_num_samples):
      """Build the train test and validation datasets.
  
      Args:
          train_val_test_num_samples : A list containing the number of samples in train test and validation.
      """
      args = get_args()
  
      print_rank_0(
          "> building train, validation, and test datasets for GPT ..."
      )
  
      train_ds, valid_ds, test_ds = BlendedMegatronDatasetBuilder(
          GPTDataset,
          train_val_test_num_samples,
          core_gpt_dataset_config_from_args(args),
      ).build()
  
      print_rank_0("> finished creating GPT datasets ...")
  
      return train_ds, valid_ds, test_ds
  
imports: import os
  import torch
  from torch import Tensor
  from functools import partial
  from typing import Union
  from megatron import get_args
  from megatron import print_rank_0
  from megatron import get_timers
  from megatron import get_tokenizer
  from megatron.core import mpu, tensor_parallel
  from megatron.core.enums import ModelType
  from megatron.core.datasets.blended_megatron_dataset_builder import BlendedMegatronDatasetBuilder
  from megatron.core.datasets.gpt_dataset import GPTDatasetConfig
  from megatron.core.datasets.gpt_dataset import GPTDataset
  import megatron.model
  from megatron.core.models.gpt import GPTModel
  from megatron.training import pretrain
  from megatron.core.transformer.spec_utils import import_module
  from megatron.utils import get_batch_on_this_cp_rank, get_batch_on_this_tp_rank, average_losses_across_data_parallel_group
  from megatron.arguments import core_transformer_config_from_args
  from megatron.core.models.gpt.gpt_layer_specs import get_gpt_layer_with_transformer_engine_spec
label_desc: Use image node_id 7 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