code: def docker(request, mock_server, mocker, monkeypatch):
      wandb_args = {"check_output": b'["wandb/deepo@sha256:abc123"]'}
      marker = request.node.get_closest_marker("wandb_args")
      if marker:
          wandb_args.update(marker.kwargs)
      docker = mocker.MagicMock()
      api_key = mocker.patch(
          "wandb.apis.InternalApi.api_key",
          new_callable=mocker.PropertyMock,
      )
      api_key.return_value = "test"
      monkeypatch.setattr(cli, "find_executable", lambda name: True)
      old_call = subprocess.call
  
      def new_call(command, **kwargs):
          if command[0] == "docker":
              return docker(command)
          else:
              return old_call(command, **kwargs)
  
      monkeypatch.setattr(subprocess, "call", new_call)
  
      monkeypatch.setattr(
          subprocess,
          "check_output",
          lambda *args, **kwargs: wandb_args["check_output"],
      )
      return docker
  
file_path: wandb/tests/pytest_tests/unit_tests_old/test_core/test_cli.py
imports: import os
  import platform
  import subprocess
  import traceback
  import pytest
  import wandb
  from wandb.apis.internal import InternalApi
  from wandb.cli import cli
label_desc: Use image node_id 1 for calling a global function with example usage: docker(request, mock_server, mocker, monkeypatch) and returns: docker, docker, old_call