class_docstr: Saves a LightningCLI config to the log_dir when training starts.
  
  Args:
      parser: The parser object used to parse the configuration.
      config: The parsed configuration that will be saved.
      config_filename: Filename for the config file.
      overwrite: Whether to overwrite an existing config file.
      multifile: When input is multiple config files, saved config preserves this structure.
      save_to_log_dir: Whether to save the config to the log_dir.
  
  Raises:
      RuntimeError: If the config file already exists in the directory to avoid overwriting a previous run
class_docstr_tok: ["Saves","a","LightningCLI","config","to","the","log_dir","when","training","starts",".","Args",":","parser",":","The","parser","object","used","to","parse","the","configuration",".","config",":","The","parsed","configuration","that","will","be","saved",".","config_filename",":","Filename","for","the","config","file",".","overwrite",":","Whether","to","overwrite","an","existing","config","file",".","multifile",":","When","input","is","multiple","config","files",",","saved","config","preserves","this","structure",".","save_to_log_dir",":","Whether","to","save","the","config","to","the","log_dir",".","Raises",":","RuntimeError",":","If","the","config","file","already","exists","in","the","directory","to","avoid","overwriting","a","previous","run"]
code: def __init__(
      self,
      parser: LightningArgumentParser,
      config: Namespace,
      config_filename: str = "config.yaml",
      overwrite: bool = False,
      multifile: bool = False,
      save_to_log_dir: bool = True,
  ) -> None:
      self.parser = parser
      self.config = config
      self.config_filename = config_filename
      self.overwrite = overwrite
      self.multifile = multifile
      self.save_to_log_dir = save_to_log_dir
      self.already_saved = False
  
      if not save_to_log_dir and not is_overridden(
          "save_config", self, SaveConfigCallback
      ):
          raise ValueError(
              "`save_to_log_dir=False` only makes sense when subclassing SaveConfigCallback to implement "
              "`save_config` and it is desired to disable the standard behavior of saving to log_dir."
          )
  
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 1 to create a new SaveConfigCallback object from inherited base classes: Callback with example: obj = SaveConfigCallback(parser, config, config_filename, overwrite, multifile, save_to_log_dir)