code: def get_shard_range(
      num_lines: int, num_rank: int, rank: int
  ) -> Tuple[int, int]:
      r"""Get the range of indices for the current rank in multi-processing.
      Args:
          num_lines (int): The number of lines to process.
          num_rank (int): The number of ranks for multi-processing in feature extraction.
          rank (int): The rank in the multi-processing.
  
      Returns:
          (int, int):
          int: The start index for the current rank.
          int: The end index for the current rank.
      """
      assert (
          1 <= rank <= num_rank
      ), f"invalid rank/num_rank {rank}/{num_rank}"
      assert (
          num_lines > 0
      ), f"Found {num_lines} files, make sure you specify the correct root directory"
      start = round(num_lines / num_rank * (rank - 1))
      end = round(num_lines / num_rank * rank)
      _LG.info(
          f"rank {rank} of {num_rank}, process {end-start} "
          f"({start}-{end}) out of {num_lines}"
      )
      return start, end
  
file_path: audio/examples/hubert/utils/feature_utils.py
imports: import logging
  from pathlib import Path
  from typing import Optional, Tuple, Union
  import torch
  import torchaudio
  from torch import Tensor
  from torch.nn import Module
  from .common_utils import _get_feat_lens_paths
label_desc: Use image node_id 1 for calling a global function with example usage: get_shard_range(num_lines, num_rank, rank) and returns: start,  end