code: def test_environment_variable_encoder_dict():
      env_vars = {"value1": "string1", "value2": {"a": "b", "c": 2}}
      res = _with_environment_variables("echo hello", env_vars)
  
      expected = """export value1='"string1"';export value2='{"a":"b","c":2}';echo hello"""  # noqa: E501
      assert res == expected
  
file_path: ray/python/ray/tests/test_command_runner.py
imports: import pytest
  from ray.tests.test_autoscaler import MockProvider, MockProcessRunner
  from ray.autoscaler.command_runner import CommandRunnerInterface
  from ray.autoscaler._private.command_runner import SSHCommandRunner, DockerCommandRunner, _with_environment_variables
  from ray.autoscaler.sdk import get_docker_host_mount_location
  from getpass import getuser
  import hashlib
label_desc: Use image node_id 2 for calling a global function with example usage: test_environment_variable_encoder_dict() without return types