code: def run(self):
      # running both `train_work_1` and `train_work_2` in parallel and asynchronously.
      self.train_work_1.run(self.data_dir)
      self.train_work_2.run(self.data_dir)
  
      # run serve_work only when both `best_model_score` are available.
      if (
          self.train_work_1.best_model_score
          and self.train_work_2.best_model_score
      ):
          # serve only the best model between `train_work_1` and `train_work_2`.
          self.server_work.run(
              self.train_work_1.best_model_path
              if self.train_work_1.best_model_score
              < self.train_work_2.best_model_score
              else self.train_work_2.best_model_path
          )
  
file_path: pytorch-lightning/docs/source-app/code_samples/quickstart/app/app_1.py
imports: import flash
  from flash.core.data.utils import download_data
  from flash.image import ImageClassificationData, ImageClassifier
  from lightning.app import LightningWork, LightningFlow, LightningApp, CloudCompute
  from lightning.pytorch.callbacks import ModelCheckpoint
label_desc: Use image node_id 2 for calling the RootFlow obj's underlying member method code with example usage: obj.run() without return types