code: def test_slurm_preemption() -> None:
      # Launch the cifar10_pytorch_cancellable experiment requesting 8 GPUs on defq_GPU_cancellable
      # partition
      cancelable_exp_id = exp.create_experiment(
          conf.cv_examples_path(
              "../legacy/computer_vision/cifar10_pytorch/cifar10_pytorch_cancelable.yaml"
          ),
          conf.cv_examples_path(
              "../legacy/computer_vision/cifar10_pytorch"
          ),
          None,
      )
      # Wait for the first cancellable experiment to enter RUNNING state.
      exp.wait_for_experiment_state(
          cancelable_exp_id, bindings.experimentv1State.RUNNING
      )
      # Wait for the first cancellable experiment to complete at least one checkpoint.
      exp.wait_for_at_least_one_checkpoint(cancelable_exp_id, 300)
      # Launch the cifar10_pytorch_high_priority experiment requesting 8 GPUs on defq_GPU_hipri
      # partition
      high_priority_exp_id = exp.create_experiment(
          conf.cv_examples_path(
              "../legacy/computer_vision/cifar10_pytorch/cifar10_pytorch_high_priority.yaml"
          ),
          conf.cv_examples_path(
              "../legacy/computer_vision/cifar10_pytorch"
          ),
          None,
      )
      # In this scenario, cifar10_pytorch_high_priority experiment will cause the
      # cifar10_pytorch_cancelable experiment to get requeued. The experiment
      # cifar10_pytorch_high_priority will execute to completion.
      exp.wait_for_experiment_state(
          cancelable_exp_id, bindings.experimentv1State.QUEUED
      )
      exp.wait_for_experiment_state(
          high_priority_exp_id, bindings.experimentv1State.RUNNING
      )
      exp.wait_for_experiment_state(
          high_priority_exp_id, bindings.experimentv1State.COMPLETED
      )
      # Now, the experiment cifar10_pytorch_cancelable will resume as soon as the requested
      # resources are available.
      exp.wait_for_experiment_state(
          cancelable_exp_id, bindings.experimentv1State.RUNNING
      )
      # Finally, the experiment cifar10_pytorch_cancelable will complete if there are no other
      # interruptions.
      exp.wait_for_experiment_state(
          cancelable_exp_id, bindings.experimentv1State.COMPLETED
      )
  
imports: import logging
  import sys
  from typing import List
  import pytest
  import torch
  from determined.common.api import bindings
  from tests import api_utils, command
  from tests import config
  from tests import experiment
label_desc: Use image node_id 11 for calling a global function with example usage: test_slurm_preemption() without return types