code: def test_recover_ssh_session(self):
      pkey = pkg_resources.resource_filename("mockssh", "server-key")
      data_folder = pkg_resources.resource_filename(__name__, "data")
      users = {
          "mockuser": pkey,
      }
      scores = {}
      mutex = Lock()
  
      config = {
          "workingdir": data_folder,
          "n_parallel": 1,
          "resource": "node",
          "proposer": "random",
          "script": os.path.join(
              data_folder, "script", "rosenbrock_hpo.py"
          ),
          "n_samples": 10,
          "random_seed": 10,
          "parameter_config": [
              {"name": "x", "type": "float", "range": [-5, 5]},
              {"name": "y", "type": "float", "range": [-5, 5]},
          ],
          "runtime_args": {
              "prescript": "export CUDA_VISIBLE_DEVICES=-1",
              "postscript": "echo $CUDA_VISIBLE_DEVICES",
              "overwrite": "true",
          },
      }
      m = rp.RandomProposer(config)
  
      def callback_fun(score, jid):
          mutex.acquire()
          scores[jid] = score
          mutex.release()
  
      server1 = mockssh.Server(users)
      server1.__enter__()
  
      mngr = SSHResourceManager(
          None,
          config["n_parallel"],
          auppath=data_folder,
          reconn_wait_time=5,
          max_retries=5,
      )
      mngr.mapping[1] = (
          "mockuser@127.0.0.1:" + str(server1.port) + " " + pkey
      )
  
      for i in range(config["n_samples"]):
          proposal = m.get()
          job1 = Job(
              config["script"],
              BasicConfig(**proposal),
              config["workingdir"],
          )
          job1.jid = i
          mngr.run(job1, 1, None, callback_fun, overwrite=True)
  
          if i == int(config["n_samples"] / 2):
              # drop server and check after reopen it if we recover
              server1.__exit__()
              del server1
              sleep(7)
              server1 = mockssh.Server(users)
              server1.__enter__()
              mngr.mapping[1] = (
                  "mockuser@127.0.0.1:" + str(server1.port) + " " + pkey
              )
      for key in scores:
          self.assertTrue(scores[key] != "ERROR")
  
imports: import unittest
  import mockssh
  import tempfile
  import pdb
  from shutil import copyfile
  from time import sleep
  from six import PY2
  import pkg_resources
  from aup.EE.Resource.SSHResourceManager import *
  from aup.EE.Job import Job
  from aup import BasicConfig
  from aup.Proposer import RandomProposer
  from aup.utils import get_default_connector
  from threading import Lock
label_desc: Use image node_id 3 for calling the SSHResourceManagerTestCase obj's underlying member method code with example usage: obj.test_recover_ssh_session() without return types