code: def test_supervisor_config():
      config = MarsSupervisorConfig(
          "/path/to/packed.tar.gz",
          "mars.test_mod",
          cpu=2,
          memory="10 GiB",
          env={"TEST_ENV": "test_val"},
          extra_args="-Dsupervisor.default_cpu_usage=0",
      ).build()
      assert config["files"]["mars_env"] == "/path/to/packed.tar.gz"
      assert "mars.deploy.yarn.supervisor" in config["script"]
  
      config_envs = config["env"]
      assert config_envs["TEST_ENV"] == "test_val"
      assert config_envs["MKL_NUM_THREADS"] == "2"
      assert config_envs["MARS_CPU_TOTAL"] == "2"
      assert int(config_envs["MARS_MEMORY_TOTAL"]) == 10 * 1024**3
      assert config_envs["MARS_LOAD_MODULES"] == "mars.test_mod"
  
      config = MarsSupervisorConfig(
          "conda://path/to_env",
          "mars.test_mod",
          cpu=2,
          memory="10 GiB",
          log_config="logging.conf",
          env={"TEST_ENV": "test_val"},
          extra_args="-Dsupervisor.default_cpu_usage=0",
      ).build()
      config_envs = config["env"]
      assert config_envs["MARS_SOURCE_PATH"] == os.path.dirname(
          os.path.dirname(mars_file)
      )
  
      config = MarsSupervisorConfig(
          "venv://path/to_env",
          "mars.test_mod",
          cpu=2,
          log_config="logging.conf",
          env={"TEST_ENV": "test_val"},
          extra_args="-Dsupervisor.default_cpu_usage=0",
      ).build()
      config_envs = config["env"]
      assert config_envs["MARS_SOURCE_PATH"] == os.path.dirname(
          os.path.dirname(mars_file)
      )
  
imports: import os
  from ....None import __file__
  from ..config import SecurityConfig, AppFileConfig, AppMasterConfig, MarsApplicationConfig, MarsSupervisorConfig, MarsWorkerConfig
label_desc: Use image node_id 2 for calling a global function with example usage: test_supervisor_config() without return types