code: def test_neptune_log_metrics_on_trained_model(neptune_mock, tmp_path):
      """Verify that trained models do log data."""
  
      class LoggingModel(BoringModel):
          def on_validation_epoch_end(self):
              self.log("some/key", 42)
  
      logger, run_instance_mock, _ = _get_logger_with_mocks(
          api_key="test", project="project"
      )
      _fit_and_test(
          logger=logger, model=LoggingModel(), tmp_path=tmp_path
      )
      run_instance_mock.__getitem__.assert_any_call("training/some/key")
      run_instance_mock.__getitem__.return_value.append.assert_has_calls(
          [call(42, step=2)]
      )
  
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 11 for calling a global function with example usage: test_neptune_log_metrics_on_trained_model(neptune_mock, tmp_path) without return types