code: def num_samples_to_block_ranges(num_samples):
      """Split a range (length num_samples) into sequence of block ranges
      of size block_size."""
      args = get_retro_args()
      block_size = args.retro_block_size
      start_idxs = list(range(0, num_samples, block_size))
      end_idxs = [min(num_samples, s + block_size) for s in start_idxs]
      ranges = list(zip(start_idxs, end_idxs))
      return ranges
  
file_path: megatron-lm/tools/retro/index/utils.py
imports: import concurrent
  import gc
  import glob
  import numpy
  import os
  import psutil
  import time
  import torch
  from tqdm import tqdm
  from megatron import get_retro_args, print_rank_0
  from tools.retro.db.utils import get_indexed_dataset_infos
  from tools.retro.external_libs import h5py
label_desc: Use image node_id 2 for calling a global function with example usage: num_samples_to_block_ranges(num_samples) and returns: ranges