docstr: Flash's extension of the :class:`pytorch_lightning.utilities.cli.LightningCLI`
  
  Args:
      model_class: The :class:`pytorch_lightning.LightningModule` class to train on.
      datamodule_class: The :class:`~flash.data.data_module.DataModule` class.
      trainer_class: An optional extension of the :class:`pytorch_lightning.Trainer` class.
      trainer_fn: The trainer function to run.
      input: Use this if your ``DataModule`` is created using a classmethod. Any of:
          - ``None``. The ``datamodule_class.__init__`` signature will be used.
          - ``str``. One of :class:`~flash.data.io.input.InputFormat`. This will use the signature of
              the corresponding ``DataModule.from_*`` method.
          - ``Callable``. A custom method.
      kwargs: See the parent arguments
docstr_tok: ["Flash","'s","extension","of","the",":","class",":","`","pytorch_lightning.utilities.cli.LightningCLI","`","Args",":","model_class",":","The",":","class",":","`","pytorch_lightning.LightningModule","`","class","to","train","on",".","datamodule_class",":","The",":","class",":","`","~flash.data.data_module.DataModule","`","class",".","trainer_class",":","An","optional","extension","of","the",":","class",":","`","pytorch_lightning.Trainer","`","class",".","trainer_fn",":","The","trainer","function","to","run",".","input",":","Use","this","if","your","``","DataModule","``","is","created","using","a","classmethod",".","Any","of",":","-","``","None","``",".","The","``","datamodule_class.__init__","``","signature","will","be","used",".","-","``","str","``",".","One","of",":","class",":","`","~flash.data.io.input.InputFormat","`",".","This","will","use","the","signature","of","the","corresponding","``","DataModule.from_","*","``","method",".","-","``","Callable","``",".","A","custom","method",".","kwargs",":","See","the","parent","arguments"]
code: def __init__(
      self,
      model_class: Type[pl.LightningModule],
      datamodule_class: Type["flash.DataModule"],
      trainer_class: Type[pl.Trainer] = flash.Trainer,
      default_datamodule_builder: Optional[Callable] = None,
      additional_datamodule_builders: Optional[List[Callable]] = None,
      default_arguments=None,
      finetune=True,
      datamodule_attributes=None,
      **kwargs: Any,
  ) -> None:
      """Flash's extension of the :class:`pytorch_lightning.utilities.cli.LightningCLI`
  
      Args:
          model_class: The :class:`pytorch_lightning.LightningModule` class to train on.
          datamodule_class: The :class:`~flash.data.data_module.DataModule` class.
          trainer_class: An optional extension of the :class:`pytorch_lightning.Trainer` class.
          trainer_fn: The trainer function to run.
          input: Use this if your ``DataModule`` is created using a classmethod. Any of:
              - ``None``. The ``datamodule_class.__init__`` signature will be used.
              - ``str``. One of :class:`~flash.data.io.input.InputFormat`. This will use the signature of
                  the corresponding ``DataModule.from_*`` method.
              - ``Callable``. A custom method.
          kwargs: See the parent arguments
  
      """
      if datamodule_attributes is None:
          datamodule_attributes = {"num_classes"}
      self.datamodule_attributes = datamodule_attributes
  
      self.default_datamodule_builder = default_datamodule_builder
      self.additional_datamodule_builders = (
          additional_datamodule_builders or []
      )
      self.default_arguments = default_arguments or {}
      self.finetune = finetune
  
      model_class = make_args_optional(
          model_class, self.datamodule_attributes
      )
      self.local_datamodule_class = datamodule_class
  
      self._subcommand_builders = {}
  
      super().__init__(
          drop_kwargs(model_class),
          datamodule_class=None,
          save_config_callback=functools.partial(
              ModelExcludeSaveConfigCallback,
              exclude_list=datamodule_attributes,
          ),
          trainer_class=trainer_class,
          **kwargs,
      )
  
imports: import contextlib
  import functools
  import inspect
  from argparse import Namespace
  from functools import wraps
  from inspect import Parameter, signature
  from typing import Any, Callable, Dict, List, Optional, Set, Type, Union
  import pytorch_lightning
  from jsonargparse import ArgumentParser, class_from_function
  from lightning_utilities.core.overrides import is_overridden
  from pytorch_lightning import LightningModule, Trainer
  import flash
  from flash.core.data.data_module import DataModule
  from flash.core.utilities.lightning_cli import LightningArgumentParser, LightningCLI, SaveConfigCallback
  from flash.core.utilities.stability import beta
label_desc: Use image node_id 1 to create a new FlashCLI object from inherited base classes: LightningCLI with example: obj = FlashCLI(model_class, datamodule_class, trainer_class, default_datamodule_builder, additional_datamodule_builders, default_arguments, finetune, datamodule_attributes)