code: def get_rank_zero_dirname(dirname):
      def func():
          import ignite.distributed as idist
  
          zero_rank_dirname = Path(idist.all_gather(str(dirname))[0])
          return zero_rank_dirname
  
      yield func
  
imports: import functools
  import os
  import shutil
  import sys
  import tempfile
  import time
  from pathlib import Path
  import pytest
  import torch
  import torch.distributed
  import ignite.distributed
label_desc: Use image node_id 4 for calling a global function with example usage: get_rank_zero_dirname(dirname) and returns: zero_rank_dirname