code: def _build_shuffle_idx(num_samples, total_size, np_rng):
      """Build the range [0, size) and shuffle."""
      print(
          " > building shuffle index with split [0, {}) and [{}, {}) "
          "...".format(num_samples, num_samples, total_size),
          flush=True,
      )
  
      dtype_ = np.uint32
      if total_size >= (np.iinfo(np.uint32).max - 1):
          dtype_ = np.int64
  
      shuffle_idx_first = np.arange(
          start=0, stop=num_samples, step=1, dtype=dtype_
      )
      np_rng.shuffle(shuffle_idx_first)
      if num_samples == total_size:
          return shuffle_idx_first
  
      shuffle_idx_last = np.arange(
          start=num_samples, stop=total_size, step=1, dtype=dtype_
      )
      np_rng.shuffle(shuffle_idx_last)
  
      return np.concatenate((shuffle_idx_first, shuffle_idx_last))
  
imports: import os
  import time
  import numpy
  import torch
  from omegaconf.dictconfig import DictConfig
  from nemo.collections.nlp.data.language_modeling.megatron.base_dataset_utils import get_datasets_weights_and_num_samples, get_train_valid_test_split_
  from nemo.collections.nlp.data.language_modeling.megatron.blendable_dataset import BlendableDataset
  from nemo.collections.nlp.data.language_modeling.megatron.indexed_dataset import deallocate_indexed_dataset_memory
  from nemo.collections.nlp.data.language_modeling.megatron.indexed_dataset import make_dataset
  from nemo.core import Dataset
  from nemo.utils import logging
label_desc: Use image node_id 11 for calling a global function with example usage: _build_shuffle_idx(num_samples, total_size, np_rng) and returns: np, shuffle_idx_first