code: def parse_num_nodes(str_num_nodes: str, elastic_training: bool):
      node_list = str_num_nodes.split(":")
  
      if len(node_list) == 1:
          min_nodes, max_nodes = int(node_list[0]), -1
      elif len(node_list) == 2 and elastic_training:
          min_nodes, max_nodes = int(node_list[0]), int(node_list[1])
      elif len(node_list) == 2 and not elastic_training:
          raise RuntimeError(
              "MIN:MAX format is only supported in elastic training"
          )
      else:
          raise RuntimeError(
              "num_nodes {} is not in MIN:MAX format".format(
                  str_num_nodes
              )
          )
  
      return min_nodes, max_nodes
  
imports: import os
  import re
  import sys
  import json
  import base64
  import argparse
  import subprocess
  import collections
  from copy import deepcopy
  import signal
  import time
  from .multinode_runner import PDSHRunner, OpenMPIRunner, MVAPICHRunner, SlurmRunner, MPICHRunner, IMPIRunner
  from .constants import PDSH_LAUNCHER, OPENMPI_LAUNCHER, MVAPICH_LAUNCHER, SLURM_LAUNCHER, MPICH_LAUNCHER, IMPI_LAUNCHER
  from ..constants import TORCH_DISTRIBUTED_DEFAULT_PORT
  from ..nebula.constants import NEBULA_EXPORT_ENVS
  from ..utils import logger
  from ..autotuning import Autotuner
  from deepspeed.accelerator import get_accelerator
label_desc: Use image node_id 9 for calling a global function with example usage: parse_num_nodes(str_num_nodes, elastic_training) and returns: min_nodes,  max_nodes