code: def main(args: argparse.Namespace):
      world_collective = TorchCollective()
      player_trainer_collective = TorchCollective()
      world_collective.setup(
          backend="nccl" if args.player_on_gpu and args.cuda else "gloo"
      )
  
      # Create a global group, assigning it to the collective: used by the player to exchange
      # collected experiences with the trainers
      world_collective.create_group()
      global_rank = world_collective.rank
  
      # Create a group between rank-0 (player) and rank-1 (trainer), assigning it to the collective:
      # used by rank-1 to send metrics to be tracked by the rank-0 at the end of a training episode
      player_trainer_collective.create_group(ranks=[0, 1])
  
      # Create a new group, without assigning it to the collective: in this way the trainers can
      # still communicate with the player through the global group, but they can optimize the agent
      # between themselves
      optimization_pg = world_collective.new_group(
          ranks=list(range(1, world_collective.world_size))
      )
      if global_rank == 0:
          player(args, world_collective, player_trainer_collective)
      else:
          trainer(
              args,
              world_collective,
              player_trainer_collective,
              optimization_pg,
          )
  
file_path: pytorch-lightning/examples/fabric/reinforcement_learning/train_fabric_decoupled.py
imports: import argparse
  import os
  import time
  from contextlib import nullcontext
  from datetime import datetime
  import gymnasium
  import torch
  from lightning.fabric import Fabric
  from lightning.fabric.loggers import TensorBoardLogger
  from lightning.fabric.plugins.collectives import TorchCollective
  from lightning.fabric.plugins.collectives.collective import CollectibleGroup
  from lightning.fabric.strategies import DDPStrategy
  from rl.agent import PPOLightningAgent
  from rl.utils import linear_annealing, make_env, parse_args, test
  from torch.distributed.algorithms.join import Join
  from torch.utils.data import BatchSampler, DistributedSampler, RandomSampler
  from torchmetrics import MeanMetric
label_desc: Use image node_id 3 for calling a global function with example usage: main(args) without return types