code: def test_log_metrics(neptune_mock):
      metrics = {
          "foo": 42,
          "bar": 555,
      }
      test_variants = [
          ({}, ("training/foo", "training/bar")),
          (
              {"prefix": "custom_prefix"},
              ("custom_prefix/foo", "custom_prefix/bar"),
          ),
          (
              {"prefix": "custom/nested/prefix"},
              ("custom/nested/prefix/foo", "custom/nested/prefix/bar"),
          ),
      ]
  
      for prefix, (metrics_foo_key, metrics_bar_key) in test_variants:
          (
              logger,
              run_instance_mock,
              run_attr_mock,
          ) = _get_logger_with_mocks(
              api_key="test", project="project", **prefix
          )
          logger.log_metrics(metrics)
          assert run_instance_mock.__setitem__.call_count == 0
          assert run_instance_mock.__getitem__.call_count == 2
          run_instance_mock.__getitem__.assert_any_call(metrics_foo_key)
          run_instance_mock.__getitem__.assert_any_call(metrics_bar_key)
          run_attr_mock.append.assert_has_calls(
              [call(42, step=None), call(555, step=None)]
          )
  
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 13 for calling a global function with example usage: test_log_metrics(neptune_mock) without return types