code: def get_master_port():
      master_port = os.environ.get("DS_TEST_PORT", "29503")
      xdist_worker_id = get_xdist_worker_id()
      if xdist_worker_id is not None:
          master_port = str(int(master_port) + xdist_worker_id)
      return master_port
  
imports: import os
  import time
  import inspect
  from abc import ABC, abstractmethod
  from pathlib import Path
  import torch
  import torch.multiprocessing
  import deepspeed
  import deepspeed.comm
  from torch.multiprocessing import Process
  import pytest
  from _pytest.outcomes import Skipped
  from _pytest.fixtures import FixtureLookupError, FixtureFunctionMarker
label_desc: Use image node_id 2 for calling a global function with example usage: get_master_port() and returns: master_port