code: def run_model_test_without_loggers(
      trainer_options: dict,
      model: LightningModule,
      data: LightningDataModule = None,
      min_acc: float = 0.50,
  ):
      # fit model
      trainer = Trainer(**trainer_options)
      trainer.fit(model, datamodule=data)
  
      # correct result and ok accuracy
      assert (
          trainer.state.finished
      ), f"Training failed with {trainer.state}"
  
      model2 = load_model_from_checkpoint(
          trainer.checkpoint_callback.best_model_path, type(model)
      )
  
      # test new model accuracy
      test_loaders = (
          model2.test_dataloader()
          if not data
          else data.test_dataloader()
      )
      if not isinstance(test_loaders, list):
          test_loaders = [test_loaders]
  
      if not isinstance(model2, BoringModel):
          for dataloader in test_loaders:
              run_model_prediction(model2, dataloader, min_acc=min_acc)
  
file_path: pytorch-lightning/tests/tests_pytorch/helpers/pipelines.py
imports: from functools import partial
  import torch
  from lightning.pytorch import LightningDataModule, LightningModule, Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.utilities.imports import _TORCHMETRICS_GREATER_EQUAL_0_11
  from torchmetrics.functional import accuracy
  from tests_pytorch.helpers.utils import get_default_logger, load_model_from_checkpoint
label_desc: Use image node_id 1 for calling a global function with example usage: run_model_test_without_loggers(trainer_options, model, data, min_acc) without return types