code: def _test_master_restart_tensorboard(
      managed_cluster: Cluster, downtime: int
  ) -> None:
      exp_id = exp.create_experiment(
          conf.fixtures_path("no_op/single-default-ckpt.yaml"),
          conf.fixtures_path("no_op"),
          None,
      )
  
      exp.wait_for_experiment_state(
          exp_id, EXP_STATE.COMPLETED, max_wait_secs=60
      )
  
      with cmd.interactive_command(
          "tensorboard", "start", "--detach", str(exp_id)
      ) as tb:
          task_id = tb.task_id
          assert task_id is not None
          wait_for_task_state("tensorboard", task_id, "RUNNING")
  
          tb_url = f"{conf.make_master_url()}proxy/{task_id}/"
          _check_tb_url(tb_url)
  
          if downtime >= 0:
              managed_cluster.kill_master()
              time.sleep(downtime)
              managed_cluster.restart_master()
  
          _check_tb_url(tb_url)
  
          print("tensorboard ok")
  
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 27 for calling a global function with example usage: _test_master_restart_tensorboard(managed_cluster, downtime) without return types