code: def opts(self, threads=2):
      opts = c10d.ProcessGroupGloo._Options()
      opts._timeout = 50.0
      opts._threads = threads
      return opts
  
file_path: pytorch/test/distributed/test_collective_utils.py
imports: from unittest import mock
  import torch.distributed
  from torch.distributed.collective_utils import all_gather, broadcast
  from torch.testing._internal.common_distributed import MultiProcessTestCase
label_desc: Use image node_id 3 for calling the TestCollectiveUtils obj's underlying member method code with example usage: obj.opts(threads) and returns: opts