code: def cli_main():
      early_stopping = EarlyStopping(
          monitor="val_loss",
      )
  
      checkpoint_callback = ModelCheckpoint(
          dirpath=os.getcwd(),
          save_top_k=1,
          verbose=True,
          monitor="val_loss",
          mode="min",
      )
      lr_logger = LearningRateMonitor()
      cli = LightningCLI(
          LightningMNISTClassifier,
          MNISTDataModule,
          run=False,
          save_config_callback=None,
          trainer_defaults={
              "callbacks": [
                  early_stopping,
                  checkpoint_callback,
                  lr_logger,
              ]
          },
      )
      if cli.trainer.global_rank == 0:
          mlflow.pytorch.autolog()
      cli.trainer.fit(cli.model, datamodule=cli.datamodule)
      cli.trainer.test(ckpt_path="best", datamodule=cli.datamodule)
  
imports: import os
  import lightning
  import torch
  from lightning.pytorch.callbacks import EarlyStopping, LearningRateMonitor, ModelCheckpoint
  from lightning.pytorch.cli import LightningCLI
  from torch.nn import functional
  from torch.utils.data import DataLoader, random_split
  from torchmetrics.functional import accuracy
  from torchvision import datasets, transforms
  import mlflow.pytorch
label_desc: Use image node_id 1 for calling a global function with example usage: cli_main() without return types