class_docstr: FATECommunicator is a wrapper around the FATE communicator.
class_docstr_tok: ["FATECommunicator","is","a","wrapper","around","the","FATE","communicator","."]
code: def new_group(self, ranks: List[int], name: str):
      assert (
          len(ranks) > 1
      ), f"new group must have more than 1 rank: {ranks}"
      assert all(
          [0 <= rank < self.world_size for rank in ranks]
      ), f"invalid ranks: {ranks}"
      assert len(set(ranks)) == len(ranks), f"duplicate ranks: {ranks}"
      namespace_tensor = self.ctx.namespace.sub_ns(f"mpc_tensor_{name}")
      namespace_obj = self.ctx.namespace.sub_ns(f"mpc_obj_{name}")
      return CommunicateGroup(ranks, namespace_tensor, namespace_obj)
  
imports: import functools
  import logging
  import sys
  import timeit
  from concurrent.futures import ThreadPoolExecutor
  import torch
  from torch.distributed import ReduceOp
  from torch.distributed import ReduceOp
  from fate.arch.context import Context, NS, Parties
  from fate.arch import trace
  from typing import List
label_desc: Use image node_id 4 for calling the Communicator obj's underlying member method code with example usage: obj.new_group(ranks, name) and returns: CommunicateGroup