code: def _override_knobs(
      knob_options: KnobOptions,
  ) -> Generator[None, None, None]:
      knobs = []
      if knob_options.max_per_rank_io_concurrency:
          knobs.append(
              override_max_per_rank_io_concurrency(
                  knob_options.max_per_rank_io_concurrency
              ),
          )
  
      with ExitStack() as stack:
          for mgr in knobs:
              stack.enter_context(mgr)
          yield
  
imports: from __future__ import annotations
  import logging
  from contextlib import contextmanager, ExitStack
  from typing import Any, Dict, Generator, Iterable, List, Optional, Set, Union
  import torch.distributed
  from torchtnt.framework.callbacks._checkpoint_utils import _prepare_app_state, _prepare_app_state_for_checkpoint, _prepare_app_state_for_restore, _TRAIN_DL_STATE_KEY
  from torchtnt.framework.callbacks.base_checkpointer import BaseCheckpointer
  from torchtnt.framework.callbacks.checkpointer_types import KnobOptions, RestoreOptions
  from torchtnt.framework.state import State
  from torchtnt.framework.unit import AppStateMixin, TEvalUnit, TPredictUnit, TTrainData, TTrainUnit
  from torchtnt.framework.utils import get_timing_context
  from torchtnt.utils.optimizer import init_optim_state
  from torchtnt.utils.rank_zero_log import rank_zero_info, rank_zero_warn
  from torchtnt.utils.stateful import Stateful
label_desc: Use image node_id 3 for calling a global function with example usage: _override_knobs(knob_options) without return types