code: def _data_pgs(
      groups: List["td.ProcessGroup"],
      num_data_pgs: int,
      server_rank: int,
  ) -> List["td.ProcessGroup"]:
      """
      Example: If num_data_pgs is 3, then one of the following list of groups with a
          ^ ^ ^ underneath is chosen.
  
          groups: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...]
                      ^  ^  ^     ^  ^  ^     ^   ^   ^
      """
      pgs_per_server = num_data_pgs + 1
      num_servers = len(groups) // pgs_per_server
      server_rank = server_rank % num_servers
      server_rank_plus_1 = (server_rank + 1) % num_servers
      if server_rank_plus_1 == 0:
          server_rank_plus_1 += num_servers
      return groups[
          (server_rank * pgs_per_server + 1) : server_rank_plus_1
          * pgs_per_server
      ]
  
imports: import logging
  import multiprocessing
  import queue
  import time
  import traceback
  from functools import lru_cache
  from typing import Callable, Dict, List, Optional, Sequence
  import torch
  import torch.distributed
  import torch.multiprocessing
  from torchbiggraph.distributed import init_process_group, Startable
  from torchbiggraph.types import CharTensorType, Rank
  from torchbiggraph.util import allocate_shared_tensor, split_almost_equally, tag_logs_with_process_name
label_desc: Use image node_id 4 for calling a global function with example usage: _data_pgs(groups, num_data_pgs, server_rank) and returns: groups