code: def split_index(start_idx, end_idx, num_partitions):
      partition_size = math.ceil((end_idx - start_idx) / num_partitions)
      partitions = [
          [
              start_idx + x * partition_size,
              min(end_idx, start_idx + (x + 1) * partition_size),
          ]
          for x in range(num_partitions)
      ]
      return partitions
  
file_path: deepspeed/deepspeed/runtime/data_pipeline/data_sampling/utils.py
imports: import math
  import numpy
  from deepspeed.utils import logger
  from .indexed_dataset import MMapIndexedDatasetBuilder
label_desc: Use image node_id 2 for calling a global function with example usage: split_index(start_idx, end_idx, num_partitions) and returns: partitions