code: def test_master_restart_continued_experiment(
      managed_cluster_restarts: ManagedCluster,
  ) -> None:
      exp_id = exp.create_experiment(
          conf.fixtures_path("no_op/single-medium-train-step.yaml"),
          conf.fixtures_path("no_op"),
          None,
      )
      exp.wait_for_experiment_state(exp_id, EXP_STATE.COMPLETED)
  
      det_cmd(
          [
              "e",
              "continue",
              str(exp_id),
              "--config",
              "searcher.max_length.batches=505",
              "--config",
              "searcher.name=single",
          ],
          check=True,
      )
  
      managed_cluster_restarts.kill_master()
      managed_cluster_restarts.restart_master()
      exp.wait_for_experiment_state(
          exp_id, EXP_STATE.COMPLETED, max_wait_secs=60
      )
  
      # We continued the latest task, not the first one.
      experiment_trials = exp.experiment_trials(exp_id)
      assert len(experiment_trials) == 1
      task_ids = experiment_trials[0].trial.taskIds
      assert task_ids is not None
      assert len(task_ids) == 2
  
      sess = api_utils.determined_test_session()
      logs = task_logs(sess, task_ids[-1])
      assert (
          "resources exited successfully with a zero exit code"
          in "".join(log.log for log in logs)
      )
  
imports: import logging
  import subprocess
  import time
  import docker
  import pytest
  import requests
  from determined.common import constants
  from determined.common.api import authentication, task_is_ready, task_logs
  from determined.common.api.bindings import experimentv1State
  from tests import api_utils
  from tests import command
  from tests import config
  from tests import experiment
  from tests.cluster.test_users import det_spawn
  from .abstract_cluster import Cluster
  from .managed_cluster import ManagedCluster, get_agent_data
  from .managed_cluster_k8s import ManagedK8sCluster
  from .test_groups import det_cmd, det_cmd_json
  from .utils import assert_command_succeeded, run_command, wait_for_command_state, wait_for_task_state
label_desc: Use image node_id 7 for calling a global function with example usage: test_master_restart_continued_experiment(managed_cluster_restarts) without return types