code: def test_model_properties_fit_ckpt_path(tmpdir):
      """Test that properties like `current_epoch` and `global_step` in model and trainer are always the same."""
      model = BoringModel()
      checkpoint_callback = ModelCheckpoint(
          dirpath=tmpdir, save_last=True
      )
      trainer_args = {
          "default_root_dir": tmpdir,
          "max_epochs": 1,
          "limit_train_batches": 2,
          "limit_val_batches": 2,
          "logger": False,
          "callbacks": [
              checkpoint_callback,
              ModelTrainerPropertyParity(),
          ],  # this performs the assertions
      }
      trainer = Trainer(**trainer_args)
      trainer.fit(model)
  
      trainer_args.update(max_epochs=2)
      trainer = Trainer(**trainer_args)
      trainer.fit(model, ckpt_path=str(tmpdir / "last.ckpt"))
  
imports: import glob
  import logging
  import os
  import pickle
  from copy import deepcopy
  from typing import Generic, Mapping, TypeVar
  import cloudpickle
  import pytest
  import torch
  from lightning.fabric import seed_everything
  from lightning.pytorch import Callback, Trainer
  from lightning.pytorch.callbacks import ModelCheckpoint
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.trainer.states import TrainerFn
  from lightning_utilities.test.warning import no_warning_call
  from torch import Tensor
  import tests_pytorch.helpers.pipelines
  import tests_pytorch.helpers.utils
  from tests_pytorch.helpers.datamodules import ClassifDataModule
  from tests_pytorch.helpers.runif import RunIf
  from tests_pytorch.helpers.simple_models import ClassificationModel
  from tests_pytorch.loops.test_loops import CustomException
label_desc: Use image node_id 1 for calling a global function with example usage: test_model_properties_fit_ckpt_path(tmpdir) without return types