docstr: wrapper function for ExecuteTARun.run_wrapper() to cap the target algorithm
  runtime if it would run over the total allowed runtime.
  
  Parameters
  ----------
  run_info : RunInfo
      Object that contains enough information to execute a configuration run in
      isolation.
  Returns
  -------
  RunInfo:
      an object containing the configuration launched
  RunValue:
      Contains information about the status/performance of config
docstr_tok: ["wrapper","function","for","ExecuteTARun.run_wrapper","(",")","to","cap","the","target","algorithm","runtime","if","it","would","run","over","the","total","allowed","runtime",".","Parameters","--","--","--","--","--","run_info",":","RunInfo","Object","that","contains","enough","information","to","execute","a","configuration","run","in","isolation",".","Returns","--","--","--","-","RunInfo",":","an","object","containing","the","configuration","launched","RunValue",":","Contains","information","about","the","status\/performance","of","config"]
code: def run_wrapper(
      self,
      run_info: RunInfo,
  ) -> Tuple[RunInfo, RunValue]:
      """
      wrapper function for ExecuteTARun.run_wrapper() to cap the target algorithm
      runtime if it would run over the total allowed runtime.
  
      Parameters
      ----------
      run_info : RunInfo
          Object that contains enough information to execute a configuration run in
          isolation.
      Returns
      -------
      RunInfo:
          an object containing the configuration launched
      RunValue:
          Contains information about the status/performance of config
      """
      if self.budget_type is None:
          if run_info.budget != 0:
              raise ValueError(
                  "If budget_type is None, budget must be.0, but is %f"
                  % run_info.budget
              )
      else:
          if run_info.budget == 0:
              run_info = run_info._replace(budget=100)
          elif run_info.budget <= 0 or run_info.budget > 100:
              raise ValueError(
                  "Illegal value for budget, must be >0 and <=100, but is %f"
                  % run_info.budget
              )
          if self.budget_type not in (
              "subsample",
              "iterations",
              "mixed",
          ):
              raise ValueError(
                  "Illegal value for budget type, must be one of "
                  "('subsample', 'iterations', 'mixed'), but is : %s"
                  % self.budget_type
              )
  
      remaining_time = self.stats.get_remaing_time_budget()
  
      if remaining_time - 5 < run_info.cutoff:
          run_info = run_info._replace(cutoff=int(remaining_time - 5))
  
      config_id = (
          run_info.config
          if isinstance(run_info.config, int)
          else run_info.config.config_id
      )
  
      if run_info.cutoff < 1.0:
          self.logger.info(
              "Not starting configuration %d because time is up"
              % config_id
          )
          return run_info, RunValue(
              status=StatusType.STOP,
              cost=self.worst_possible_result,
              time=0.0,
              additional_info={},
              starttime=time.time(),
              endtime=time.time(),
          )
      elif run_info.cutoff != int(
          np.ceil(run_info.cutoff)
      ) and not isinstance(run_info.cutoff, int):
          run_info = run_info._replace(
              cutoff=int(np.ceil(run_info.cutoff))
          )
  
      self.logger.info(
          "Starting to evaluate configuration %d" % config_id
      )
      return super().run_wrapper(run_info=run_info)
  
imports: from __future__ import annotations
  from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type, Union, cast
  import functools
  import json
  import logging
  import math
  import multiprocessing
  import time
  import traceback
  from queue import Empty
  import numpy
  import pynisher
  from ConfigSpace import Configuration
  from sklearn.model_selection._split import BaseCrossValidator, BaseShuffleSplit, _RepeatedSplits
  from smac.runhistory.runhistory import RunInfo, RunValue
  from smac.stats.stats import Stats
  from smac.tae import StatusType, TAEAbortException
  from smac.tae.execute_func import AbstractTAFunc
  import autosklearn.evaluation.test_evaluator
  import autosklearn.evaluation.train_evaluator
  import autosklearn.evaluation.util
  import autosklearn.pipeline.components
  from autosklearn.automl_common.common.utils.backend import Backend
  from autosklearn.evaluation.train_evaluator import TYPE_ADDITIONAL_INFO
  from autosklearn.metrics import Scorer
  from autosklearn.util.logging_ import PickableLoggerAdapter, get_named_client_logger
  from autosklearn.util.parallel import preload_modules
label_desc: Use image node_id 2 for calling the ExecuteTaFuncWithQueue obj's underlying member method code with example usage: obj.run_wrapper(run_info) and returns: super, run_info,  RunValue