code: def test_tpu_docker_run_init():
      num_workers = 1
      process_runner = MockProcessRunner()
      provider = MockProvider()
      instance = MockTpuInstance(num_workers=num_workers)
      provider.create_node({}, {}, 1)
      cluster_name = "cluster"
      docker_config = {
          "container_name": "container",
          "image": "rayproject/ray:latest",
      }
      args = {
          "instance": instance,
          "log_prefix": "prefix",
          "node_id": "0",
          "provider": provider,
          "auth_config": auth_config,
          "cluster_name": cluster_name,
          "process_runner": process_runner,
          "use_internal_ip": False,
          "docker_config": docker_config,
      }
      cmd_runner = TPUCommandRunner(**args)
  
      # Taken from tests/test_command_runner.py
      # This mocks the response of 'docker inspect' command to return an empty JSON array.
      # This simulates the scenario where the Docker image has no set environment
      # variables, allowing us to test the subsequent code for handling this case.
      process_runner.respond_to_call("json .Config.Env", 2 * ["[]"])
      cmd_runner.run_init(
          as_head=True, file_mounts={}, sync_run_yet=True
      )
      process_runner.assert_has_call("1.2.3.4", pattern="docker")
  
file_path: ray/python/ray/tests/gcp/test_gcp_tpu_command_runner.py
imports: import pytest
  import os
  from ray.tests.test_autoscaler import MockProvider, MockProcessRunner
  from ray.autoscaler._private.gcp.tpu_command_runner import TPUCommandRunner
  from ray.autoscaler._private.command_runner import SSHCommandRunner
  from ray._private import ray_constants
  from getpass import getuser
  import hashlib
  from unittest.mock import patch
label_desc: Use image node_id 3 for calling a global function with example usage: test_tpu_docker_run_init() without return types