code: def docker_client() -> docker.DockerClient:
      docker_client = docker.from_env()
      prev_containers = docker_client.containers.list(all=True)
  
      for container in prev_containers:
          container.stop()
  
      docker_client.containers.prune()
  
      return docker_client
  
imports: import os
  from typing import Text
  import docker
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: docker_client() and returns: docker_client