code: def test_create_torchrun_command_local(self) -> None:
      deepspeed_conf = "path/to/deepspeed"
      train_file_path = "path/to/exec"
      num_procs = 10
      input_params: Dict[str, Any] = {}
      input_params["local_mode"] = True
      input_params["num_processes"] = num_procs
      input_params["deepspeed_config"] = deepspeed_conf
  
      torchrun_local_args_expected = ["--standalone", "--nnodes=1"]
      with self.subTest(
          msg="Testing local training with no extra args"
      ):
          local_cmd_no_args_expected = [
              sys.executable,
              "-m",
              "torch.distributed.run",
              *torchrun_local_args_expected,
              f"--nproc_per_node={num_procs}",
              train_file_path,
              "--deepspeed",
              "--deepspeed_config",
              deepspeed_conf,
          ]
          local_cmd = (
              DeepspeedTorchDistributor._create_torchrun_command(
                  input_params, train_file_path
              )
          )
          self.assertEqual(local_cmd, local_cmd_no_args_expected)
      with self.subTest(
          msg="Testing local training with extra args for the training script"
      ):
          local_mode_version_args = ["--arg1", "--arg2"]
          local_cmd_args_expected = [
              sys.executable,
              "-m",
              "torch.distributed.run",
              *torchrun_local_args_expected,
              f"--nproc_per_node={num_procs}",
              train_file_path,
              *local_mode_version_args,
              "--deepspeed",
              "--deepspeed_config",
              deepspeed_conf,
          ]
  
          local_cmd_with_args = (
              DeepspeedTorchDistributor._create_torchrun_command(
                  input_params,
                  train_file_path,
                  *local_mode_version_args,
              )
          )
          self.assertEqual(local_cmd_with_args, local_cmd_args_expected)
  
imports: from contextlib import contextmanager
  import os
  import shutil
  import sys
  import textwrap
  from typing import Any, Callable, Dict, Tuple
  import unittest
  from pyspark import SparkConf, SparkContext
  from pyspark.ml.deepspeed.deepspeed_distributor import DeepspeedTorchDistributor
  from pyspark.sql import SparkSession
  from pyspark.ml.torch.tests.test_distributor import get_local_mode_conf, set_up_test_dirs, get_distributed_mode_conf
label_desc: Use image node_id 5 for calling the DeepspeedTorchDistributorUnitTests obj's underlying member method code with example usage: obj.test_create_torchrun_command_local() without return types