code: def is_warmstarteable(
      algo: BaseAlgorithm | type[BaseAlgorithm] | str | AlgoWrapper,
  ) -> (
      TypeGuard[
          WarmStarteable
          | AlgoWrapper[WarmStarteable]
          | type[WarmStarteable]
      ]
      | bool
  ):
      """Returns whether the given algo type or instance supports warm-starting.
  
      Parameters
      ----------
      algo : Union[BaseAlgorithm, Type[BaseAlgorithm]]
          Algorithm type or instance.
  
      Returns
      -------
      bool
          Whether the input is a warm-starteable algorithm.
      """
      if isinstance(algo, AlgoWrapper):
          # NOTE: Not going directly to algo.unwrapped, because the MultiTask wrapper makes the algo
          # WarmStarteable. Check down the chain of wrappers instead.
          return isinstance(algo, WarmStarteable) or is_warmstarteable(
              algo.algorithm
          )
      if isinstance(algo, BaseAlgorithm):
          return isinstance(algo, WarmStarteable)
      if isinstance(algo, str):
          # NOTE: I don't think the algorithm should ever be a string, since now we pass the algo
          # class in create_algo. Adding this here in case it comes in handy at some point.
          algo_type = algo_factory.get_class(algo)
          return is_warmstarteable(algo_type)
      if inspect.isclass(algo):
          return issubclass(algo, WarmStarteable)
      raise NotImplementedError(
          f"Don't know how to tell if {algo} is a warm-starteable algorithm."
      )
  
file_path: orion/src/orion/core/worker/warm_start/warm_starteable.py
imports: from __future__ import annotations
  import inspect
  from abc import ABC, abstractmethod
  from typing import overload
  from typing_extensions import TypeGuard
  from orion.algo.base import BaseAlgorithm, algo_factory
  from orion.core.worker.algo_wrappers.algo_wrapper import AlgoWrapper
  from orion.core.worker.experiment_config import ExperimentConfig
  from orion.core.worker.trial import Trial
label_desc: Use image node_id 5 for calling a global function with example usage: is_warmstarteable(algo) and returns: unknown, isinstance, is_warmstarteable, issubclass