code: def test_launch_layer_exit(
      collect_trial_profiles: Callable[[int], None]
  ) -> None:
      config = conf.load_config(
          conf.tutorials_path("mnist_pytorch/const.yaml")
      )
      config = conf.set_entrypoint(
          config,
          "python3 -m nonexistent_launch_module python3 train.py",
      )
      config["max_restarts"] = 0
  
      experiment_id = exp.run_failure_test_with_temp_config(
          config, conf.tutorials_path("mnist_pytorch")
      )
      trials = exp.experiment_trials(experiment_id)
      Determined(conf.make_master_url()).get_trial(trials[0].trial.id)
  
      collect_trial_profiles(trials[0].trial.id)
  
      slurm_run = exp.check_if_string_present_in_trial_logs(
          trials[0].trial.id, "Exited with exit code 1"
      )
      pbs_run = exp.check_if_string_present_in_trial_logs(
          trials[0].trial.id, "exited with status 1"
      )
      cpu_run = exp.check_if_string_present_in_trial_logs(
          trials[0].trial.id,
          "container failed with non-zero exit code: 1",
      )
  
      assert cpu_run or slurm_run or pbs_run
  
imports: from typing import Callable
  import pytest
  from determined.experimental import Determined
  from tests import config
  from tests import experiment
label_desc: Use image node_id 2 for calling a global function with example usage: test_launch_layer_exit(collect_trial_profiles) without return types