code: def run_ddp_only_once(num_gpus: int, strategy: str):
      if strategy in DDP_STRATEGIES:
          global FIRST_DDP_RUN  # Use the global variable to make sure it is tracked per process
          if "FIRST_DDP_RUN" in globals() and not FIRST_DDP_RUN:
              # not the first time running DDP, set number of devices to 1 (use single GPU)
              return min(1, num_gpus), "auto"
          else:
              if num_gpus > 1:
                  FIRST_DDP_RUN = False  # run DDP for the first time, disable the following runs
      return num_gpus, strategy
  
imports: import contextlib
  import logging
  import math
  import sys
  import warnings
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  from lightning.pytorch.accelerators import find_usable_cuda_devices
  from torch import nn
  from autogluon.common.utils.resource_utils import ResourceManager
  from ..constants import DDP_STRATEGIES, OBJECT_DETECTION, OCR
label_desc: Use image node_id 13 for calling a global function with example usage: run_ddp_only_once(num_gpus, strategy) and returns: num_gpus,  strategy, min,  str