code: def test_idist_parallel_spawn_n_procs_native(
      init_method, backend, dirname
  ):
      if init_method == "FILE":
          init_method = f"file://{dirname}/shared"
  
      nproc_per_node = (
          torch.cuda.device_count() if torch.cuda.is_available() else 4
      )
      device = torch.device(
          "cuda" if torch.cuda.is_available() else "cpu"
      )
      with idist.Parallel(
          backend=backend,
          nproc_per_node=nproc_per_node,
          init_method=init_method,
      ) as parallel:
          parallel.run(
              _test_func,
              ws=nproc_per_node,
              device=device,
              backend=backend,
              true_init_method=init_method,
          )
  
imports: import os
  import subprocess
  import sys
  from pathlib import Path
  import pytest
  import torch
  from packaging.version import Version
  import ignite.distributed
  from ignite.distributed.utils import has_hvd_support, has_native_dist_support, has_xla_support
label_desc: Use image node_id 15 for calling a global function with example usage: test_idist_parallel_spawn_n_procs_native(init_method, backend, dirname) without return types