code: def test_wandb_log_model_with_score(wandb_mock, tmp_path):
      """Test to prevent regression on #15543, ensuring the score is logged as a Python number, not a scalar tensor."""
      wandb_mock.run = None
      model = BoringModel()
  
      wandb_mock.init().log_artifact.reset_mock()
      wandb_mock.init.reset_mock()
      wandb_mock.Artifact.reset_mock()
      logger = WandbLogger(save_dir=tmp_path, log_model=True)
      logger.experiment.id = "1"
      logger.experiment.name = "run_name"
      checkpoint_callback = ModelCheckpoint(monitor="step")
      trainer = Trainer(
          default_root_dir=tmp_path,
          logger=logger,
          callbacks=[checkpoint_callback],
          max_epochs=1,
          limit_train_batches=3,
          limit_val_batches=1,
      )
      trainer.fit(model)
  
      calls = wandb_mock.Artifact.call_args_list
      assert len(calls) == 1
      score = calls[0][1]["metadata"]["score"]
      # model checkpoint monitors scalar tensors, but wandb can't serializable them - expect Python scalars in metadata
      assert isinstance(score, int)
      assert score == 3
  
imports: import os
  import pickle
  from unittest import mock
  import pytest
  import yaml
  from lightning.pytorch import Trainer
  from lightning.pytorch.callbacks import ModelCheckpoint
  from lightning.pytorch.cli import LightningCLI
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.loggers import WandbLogger
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning_utilities.test.warning import no_warning_call
label_desc: Use image node_id 7 for calling a global function with example usage: test_wandb_log_model_with_score(wandb_mock, tmp_path) without return types