code: def add_process_set(
      process_set: Union[ProcessSet, Sequence[int]]
  ) -> ProcessSet:
      """Add a new process_set after Horovod initialization and return it.
  
      Requires running with HOROVOD_DYNAMIC_PROCESS_SETS=1. No process set containing the same ranks may exist already.
      The returned process set will be fully initialized.
      """
      assert _basics is not None
      if not isinstance(process_set, ProcessSet):
          process_set = ProcessSet(process_set)
      if process_set.ranks is None and process_set.mpi_comm is not None:
          raise NotImplementedError(
              "Dynamically adding process sets defined by an MPI communicator is not implemented. "
              "Please build the process set via a list of ranks."
          )
      assert process_set.ranks is not None
  
      process_set_id = _basics._add_process_set_impl(process_set.ranks)
      if process_set_id is None:
          raise ValueError(
              f"Attempted to add a duplicate process set: {process_set}"
          )
      process_set.process_set_id = process_set_id
      return process_set
  
file_path: horovod/horovod/common/process_sets.py
imports: from typing import *
  from horovod.common.util import is_iterable
label_desc: Use image node_id 4 for calling a global function with example usage: add_process_set(process_set) and returns: process_set