code: def test_after_save_checkpoint(neptune_mock):
      test_variants = [
          ({}, "training/model"),
          ({"prefix": "custom_prefix"}, "custom_prefix/model"),
          (
              {"prefix": "custom/nested/prefix"},
              "custom/nested/prefix/model",
          ),
      ]
  
      for prefix, model_key_prefix in test_variants:
          (
              logger,
              run_instance_mock,
              run_attr_mock,
          ) = _get_logger_with_mocks(
              api_key="test", project="project", **prefix
          )
          models_root_dir = os.path.join("path", "to", "models")
          cb_mock = MagicMock(
              dirpath=models_root_dir,
              last_model_path=os.path.join(models_root_dir, "last"),
              best_k_models={
                  f"{os.path.join(models_root_dir, 'model1')}": None,
                  f"{os.path.join(models_root_dir, 'model2/with/slashes')}": None,
              },
              best_model_path=os.path.join(
                  models_root_dir, "best_model"
              ),
              best_model_score=None,
          )
  
          mock_file = neptune_mock.types.File
          mock_file.reset_mock()
          mock_file.side_effect = mock.Mock()
          logger.after_save_checkpoint(cb_mock)
  
          assert run_instance_mock.__setitem__.call_count == 3
          assert run_instance_mock.__getitem__.call_count == 2
          assert run_attr_mock.upload.call_count == 2
  
          assert mock_file.from_stream.call_count == 2
  
          run_instance_mock.__getitem__.assert_any_call(
              f"{model_key_prefix}/checkpoints/model1"
          )
          run_instance_mock.__getitem__.assert_any_call(
              f"{model_key_prefix}/checkpoints/model2/with/slashes"
          )
  
          run_attr_mock.upload.assert_has_calls(
              [
                  call(os.path.join(models_root_dir, "model1")),
                  call(
                      os.path.join(
                          models_root_dir, "model2/with/slashes"
                      )
                  ),
              ]
          )
  
imports: import os
  import pickle
  from collections import namedtuple
  from unittest import mock
  from unittest.mock import MagicMock, call
  import lightning.pytorch
  import pytest
  import torch
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.loggers import NeptuneLogger
label_desc: Use image node_id 15 for calling a global function with example usage: test_after_save_checkpoint(neptune_mock) without return types