code: def test_complex():
      config = FileConfigReader(
          get_test_config_path("test_ray_complex.yaml")
      ).get_autoscaling_config()
      assert config.get_head_setup_commands() == [
          "echo a",
          "echo b",
          "echo ${echo hi}",
          "echo head",
      ]
      assert config.get_head_start_ray_commands() == [
          "ray stop",
          "ray start --head --autoscaling-config=~/ray_bootstrap_config.yaml",
      ]
      assert config.get_worker_setup_commands("worker_nodes") == [
          "echo a",
          "echo b",
          "echo ${echo hi}",
          "echo worker",
      ]
      assert config.get_worker_start_ray_commands() == [
          "ray stop",
          "ray start --address=$RAY_HEAD_IP",
      ]
      assert config.get_worker_setup_commands("worker_nodes1") == [
          "echo worker1",
      ]
  
      assert config.get_docker_config("head_node") == {
          "image": "anyscale/ray-ml:head-default",
          "container_name": "ray_container",
          "pull_before_run": True,
      }
  
      assert config.get_docker_config("default") == {
          "image": "anyscale/ray-ml:worker-default",
          "container_name": "ray_container",
          "pull_before_run": True,
      }
  
      assert config.get_docker_config("worker_nodes") == {
          "image": "anyscale/ray-ml:worker-default",
          "container_name": "ray_container",
          "pull_before_run": True,
      }
  
      assert config.get_docker_config("worker_nodes1") == {
          "image": "anyscale/ray-ml:worker_nodes1",
          "container_name": "ray_container",
          "pull_before_run": True,
      }
  
      assert config.get_initialization_commands("worker_nodes") == [
          "echo what"
      ]
  
      assert config.get_initialization_commands("worker_nodes1") == [
          "echo init"
      ]
  
      assert config.get_node_resources("worker_nodes1") == {"CPU": 2}
  
      assert config.get_node_resources("worker_nodes") == {}
  
      assert config.get_node_labels("worker_nodes1") == {"foo": "bar"}
  
      assert config.get_config("cluster_name") == "test-cli"
      assert config.get_config("non-existing", "default") == "default"
      assert config.get_config("non-existing") is None
  
file_path: ray/python/ray/autoscaler/v2/tests/test_config.py
imports: import os
  import sys
  import pytest
  from ray._private.test_utils import get_test_config_path
  from ray.autoscaler import AUTOSCALER_DIR_PATH
  from ray.autoscaler.v2.instance_manager.config import FileConfigReader
label_desc: Use image node_id 2 for calling a global function with example usage: test_complex() without return types