class_docstr: Manage NNI experiment.
  
  You can either specify an :class:`ExperimentConfig` object, or a training service name.
  If a platform name is used, a blank config template for that training service will be generated.
  
  When configuration is completed, use :meth:`Experiment.run` to launch the experiment.
  
  Parameters
  ----------
  config_or_platform
      See :class:`~nni.experiment.config.ExperimentConfig`.
  id
      Experiment ID. If not specified, a random ID will be generated.
      If specified, the ID should be unique to avoid conflict with existing experiments.
      The only case when you need to specify an existing ID is when you want to resume an experiment.
  
  Example
  -------
  .. code-block::
  
      experiment = Experiment('remote')
      experiment.config.trial_command = 'python3 trial.py'
      experiment.config.machines.append(RemoteMachineConfig(ip=..., user_name=...))
      ...
      experiment.run(8080)
  
  Attributes
  ----------
  config
      Experiment configuration.
  id
      Experiment ID.
  port
      Web portal port. Or ``None`` if the experiment is not running.
class_docstr_tok: ["Manage","NNI","experiment",".","You","can","either","specify","an",":","class",":","`","ExperimentConfig","`","object",",","or","a","training","service","name",".","If","a","platform","name","is","used",",","a","blank","config","template","for","that","training","service","will","be","generated",".","When","configuration","is","completed",",","use",":","meth",":","`","Experiment.run","`","to","launch","the","experiment",".","Parameters","--","--","--","--","--","config_or_platform","See",":","class",":","`","~nni.experiment.config.ExperimentConfig","`",".","id","Experiment","ID",".","If","not","specified",",","a","random","ID","will","be","generated",".","If","specified",",","the","ID","should","be","unique","to","avoid","conflict","with","existing","experiments",".","The","only","case","when","you","need","to","specify","an","existing","ID","is","when","you","want","to","resume","an","experiment",".","Example","--","--","--","-","..","code-block",":",":","experiment","=","Experiment","(","'remote","'",")","experiment.config.trial_command","=","'python3","trial.py'","experiment.config.machines.append","(","RemoteMachineConfig","(","ip=","...",",","user_name=","...",")",")","...","experiment.run","(","8080",")","Attributes","--","--","--","--","--","config","Experiment","configuration",".","id","Experiment","ID",".","port","Web","portal","port",".","Or","``","None","``","if","the","experiment","is","not","running","."]
code: def _start_nni_manager(
      self,
      port: int,
      debug: bool,
      run_mode: RunMode = RunMode.Background,
      tuner_command_channel: str | None = None,
      tags: list[str] = [],
  ) -> None:
      assert self.config is not None
      config = self.config.canonical_copy()
      if config.use_annotation:
          raise RuntimeError(
              "NNI annotation is not supported by Python experiment API."
          )
  
      self._proc = launcher.start_experiment(
          self._action,
          self.id,
          config,
          port,
          debug,
          run_mode,
          self.url_prefix,
          tuner_command_channel,
          tags,
      )
      assert self._proc is not None
  
      self.port = port  # port will be None if start up failed
  
      ips = [config.nni_manager_ip]
      for interfaces in psutil.net_if_addrs().values():
          for interface in interfaces:
              if interface.family == socket.AF_INET:
                  ips.append(interface.address)
      ips = [f"http://{ip}:{port}" for ip in ips if ip]
      msg = "Web portal URLs: ${CYAN}" + " ".join(ips)
      _logger.info(msg)
  
imports: from __future__ import annotations
  import atexit
  from enum import Enum
  import logging
  from pathlib import Path
  import socket
  from subprocess import Popen
  import time
  from typing import Any, cast
  import psutil
  from typing_extensions import Literal
  from nni.runtime.log import start_experiment_logging, stop_experiment_logging
  from nni.tools.nnictl.config_utils import Experiments
  from .config import ExperimentConfig
  from .data import TrialJob, TrialMetricData, TrialResult
  from .None import launcher
  from .None import management
  from .None import rest
  from ..tools.nnictl.command_utils import kill_command
label_desc: Use image node_id 3 for calling the Experiment obj's underlying member method code with example usage: obj._start_nni_manager(port, debug, run_mode, tuner_command_channel, tags) without return types