code: def has_validation_loop(trainer: pl.Trainer):
      return (
          trainer.fit_loop.epoch_loop.val_loop._data_source.is_defined()
      )
  
label_desc: Use image node_id 1 for calling a global function with example usage: has_validation_loop(trainer) and returns: trainer