code: def build_train_valid_test_datasets(
      build_train_valid_test_datasets_provider,
  ):
      """Build pretraining datasets."""
  
      args = get_args()
  
      # Number of train/valid/test samples.
      if args.train_samples:
          train_samples = args.train_samples
      else:
          train_samples = args.train_iters * args.global_batch_size
      eval_iters = (
          args.train_iters // args.eval_interval + 1
      ) * args.eval_iters
      test_iters = args.eval_iters
      train_val_test_num_samples = [
          train_samples,
          eval_iters * args.global_batch_size,
          test_iters * args.global_batch_size,
      ]
      print_rank_0(" > datasets target sizes (minimum size):")
      print_rank_0(
          "    train:      {}".format(train_val_test_num_samples[0])
      )
      print_rank_0(
          "    validation: {}".format(train_val_test_num_samples[1])
      )
      print_rank_0(
          "    test:       {}".format(train_val_test_num_samples[2])
      )
  
      # Build the datasets.
      return build_train_valid_test_datasets_provider(
          train_val_test_num_samples
      )
  
imports: import gc
  from datetime import datetime
  import math
  import logging
  import sys
  from .log_handler import CustomHandler
  from .theoretical_memory_usage import report_theoretical_memory
  import time
  import torch
  from megatron import get_args
  from megatron import get_signal_handler
  from megatron import get_timers
  from megatron import get_tensorboard_writer
  from megatron import get_wandb_writer
  from megatron import get_current_global_batch_size
  from megatron import get_num_microbatches
  from megatron import is_last_rank
  from megatron import update_num_microbatches
  from megatron.core import mpu, tensor_parallel
  from megatron.core.utils import get_model_config
  from megatron import print_rank_0
  from megatron import print_rank_last
  from megatron.checkpointing import load_checkpoint
  from megatron.checkpointing import save_checkpoint
  from megatron.model import Float16Module
  from megatron.model import GPTModel
  from megatron.core.distributed import DistributedDataParallel
  from megatron.core.distributed import finalize_model_grads
  from megatron.core.enums import ModelType
  from megatron.optimizer import get_megatron_optimizer
  from megatron.initialize import initialize_megatron
  from megatron.initialize import write_args_to_tensorboard
  from megatron.initialize import set_jit_fusion_options
  from megatron.optimizer_param_scheduler import OptimizerParamScheduler
  from megatron.utils import check_adlr_autoresume_termination
  from megatron.utils import unwrap_model
  from megatron.data.data_samplers import build_pretraining_data_loader
  from megatron.utils import calc_params_l2_norm
  from megatron.core.pipeline_parallel import get_forward_backward_func
  from megatron.utils import report_memory
  from megatron.model.vision.knn_monitor import compute_feature_bank
label_desc: Use image node_id 15 for calling a global function with example usage: build_train_valid_test_datasets(build_train_valid_test_datasets_provider) and returns: build_train_valid_test_datasets_provider