code: def docker_client() -> docker.client:
      global _docker_client
      if not _docker_client:
          _docker_client = docker.from_env()
      return _docker_client
  
imports: import contextlib
  import os
  import pathlib
  import re
  import socket
  import subprocess
  import sys
  import tempfile
  import threading
  import time
  from typing import Any, Callable, Dict, Generator, List, Optional, Sequence, Type
  import appdirs
  import docker
  from determined.common import constants, util
  from determined.deploy.errors import MasterTimeoutExpired
  from determined.deploy.healthcheck import wait_for_master
label_desc: Use image node_id 1 for calling a global function with example usage: docker_client() and returns: _docker_client