code: def _get_manager(cluster_info, host, executor_id):
      """Returns this executor's "singleton" instance of the multiprocessing.Manager, reconnecting per python-worker if needed.
  
      Args:
        :cluster_info: cluster node reservations
        :host: host IP address
        :executor_id: unique id per executor (created during initial call to run())
  
      Returns:
        TFManager instance for this executor/python-worker
      """
      for node in cluster_info:
          if (
              node["host"] == host
              and node["executor_id"] == executor_id
          ):
              addr = node["addr"]
              authkey = node["authkey"]
              TFSparkNode.mgr = TFManager.connect(addr, authkey)
              break
  
      if TFSparkNode.mgr is None:
          msg = (
              "No TFManager found on this node, please ensure that:\n"
              + "1. Spark num_executors matches TensorFlow cluster_size\n"
              + "2. Spark tasks per executor is 1\n"
              + "3. Spark dynamic allocation is disabled\n"
              + "4. There are no other root-cause exceptions on other nodes\n"
          )
          raise Exception(msg)
  
      logger.info(
          "Connected to TFSparkNode.mgr on {0}, executor={1}, state={2}".format(
              host, executor_id, str(TFSparkNode.mgr.get("state"))
          )
      )
      return TFSparkNode.mgr
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import nested_scopes
  from __future__ import print_function
  import json
  import logging
  import multiprocessing
  import os
  import pkg_resources
  import platform
  import socket
  import subprocess
  import sys
  import uuid
  import time
  import traceback
  from packaging import version
  from threading import Thread
  from .None import TFManager
  from .None import TFNode
  from .None import gpu_info
  from .None import marker
  from .None import reservation
  from .None import util
label_desc: Use image node_id 3 for calling a global function with example usage: _get_manager(cluster_info, host, executor_id) and returns: TFSparkNode