code: def split_world_in_process_groups(
      world_size: int, group_size: int
  ) -> List[List[int]]:
      """
      Split the process ids of the worlds (from 0 to world_size-1) into chunks
      of size bounded by group_size.
  
      Examples:
  
          > split_world_in_process_groups(world_size=9, group_size=3)
          [[0, 1, 2], [3, 4, 5], [6, 7, 8]]
  
          > split_world_in_process_groups(world_size=9, group_size=4)
          [[0, 1, 2, 3], [4, 5, 6, 7], [8]]
  
          > split_world_in_process_groups(world_size=15, group_size=4)
          [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11], [12, 13, 14]]
  
      """
      all_groups = []
      all_ids = list(reversed(range(world_size)))
      while all_ids:
          all_groups.append(all_ids[-group_size:][::-1])
          all_ids = all_ids[:-group_size]
      return all_groups
  
imports: import logging
  import math
  import warnings
  from enum import Enum
  from typing import Dict, List, Tuple
  import torch
  import torch.distributed
  import torch.nn
  import torch.nn.functional
  from torch.nn.modules.utils import _ntuple
  from torch.utils.checkpoint import checkpoint
  from vissl.data.collators.collator_helper import MultiDimensionalTensor
  from vissl.utils.activation_checkpointing import checkpoint_trunk
  from vissl.utils.env import get_machine_local_and_dist_rank
  from vissl.utils.misc import is_apex_available
label_desc: Use image node_id 6 for calling a global function with example usage: split_world_in_process_groups(world_size, group_size) and returns: all_groups