code: def test_autoscaling_config(
      ray_cr_in: Dict[str, Any],
      expected_config_out: Optional[Dict[str, Any]],
      expected_error: Optional[Exception],
      expected_error_message: Optional[str],
      expected_log_warning: Optional[str],
  ):
      ray_cr_in["metadata"]["namespace"] = "default"
      with mock.patch(
          f"{AUTOSCALING_CONFIG_MODULE_PATH}.logger"
      ) as mock_logger:
          if expected_error:
              with pytest.raises(
                  expected_error, match=expected_error_message
              ):
                  _derive_autoscaling_config_from_ray_cr(ray_cr_in)
          else:
              assert (
                  _derive_autoscaling_config_from_ray_cr(ray_cr_in)
                  == expected_config_out
              )
              if expected_log_warning:
                  mock_logger.warning.assert_called_with(
                      expected_log_warning
                  )
              else:
                  mock_logger.warning.assert_not_called()
  
imports: import copy
  from pathlib import Path
  import requests
  from typing import Any, Dict, Optional
  from unittest import mock
  import platform
  import pytest
  import yaml
  from ray.autoscaler._private.kuberay.autoscaling_config import _derive_autoscaling_config_from_ray_cr, AutoscalingConfigProducer, _round_up_k8s_quantity
label_desc: Use image node_id 12 for calling a global function with example usage: test_autoscaling_config(ray_cr_in, expected_config_out, expected_error, expected_error_message, expected_log_warning) without return types