class_docstr: Implementation of a configurable command line tool for pytorch-lightning.
class_docstr_tok: ["Implementation","of","a","configurable","command","line","tool","for","pytorch-lightning","."]
docstr: Creates argument links for optimizers and learning rate schedulers that specified a ``link_to``.
code: def link_optimizers_and_lr_schedulers(
      parser: LightningArgumentParser,
  ) -> None:
      """Creates argument links for optimizers and learning rate schedulers that specified a ``link_to``."""
      optimizers_and_lr_schedulers = {
          **parser._optimizers,
          **parser._lr_schedulers,
      }
      for key, (
          class_type,
          link_to,
      ) in optimizers_and_lr_schedulers.items():
          if link_to == "AUTOMATIC":
              continue
          if isinstance(class_type, tuple):
              parser.link_arguments(key, link_to)
          else:
              add_class_path = _add_class_path_generator(class_type)
              parser.link_arguments(
                  key, link_to, compute_fn=add_class_path
              )
  
imports: import os
  import sys
  from functools import partial, update_wrapper
  from types import MethodType
  from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, Union
  import torch
  from lightning_utilities.core.imports import RequirementCache
  from lightning_utilities.core.rank_zero import _warn
  from torch.optim import Optimizer
  from typing_extensions import override
  import lightning.pytorch
  from lightning.fabric.utilities.cloud_io import get_filesystem
  from lightning.fabric.utilities.types import _TORCH_LRSCHEDULER
  from lightning.pytorch import Callback, LightningDataModule, LightningModule, Trainer, seed_everything
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.model_helpers import is_overridden
  from lightning.pytorch.utilities.rank_zero import rank_zero_warn
label_desc: Use image node_id 12 for calling the LightningCLI obj's underlying member method code with example usage: obj.link_optimizers_and_lr_schedulers(parser) without return types