code: def test_values_registered_on_epoch_with_logging(
      wandb: mock.MagicMock, metric: str, expected: List[str]
  ) -> None:
      wandb.sdk.wandb_run.Run = mock.MagicMock
  
      study = optuna.create_study()
      wandbc = WeightsAndBiasesCallback(
          metric_name=metric, as_multirun=True
      )
  
      @wandbc.track_in_wandb()
      def _decorated_objective(trial: optuna.trial.Trial) -> float:
          result = _objective_func(trial)
          wandb.run.log({"result": result})
          return result
  
      study.enqueue_trial({"x": 2, "y": 3})
      study.optimize(
          _decorated_objective, n_trials=1, callbacks=[wandbc]
      )
  
      logged_in_decorator = wandb.run.log.mock_calls[0][1][0]
      logged_in_callback = wandb.run.log.mock_calls[1][1][0]
      assert len(wandb.run.log.mock_calls) == 2
      assert list(logged_in_decorator) == ["result"]
      assert list(logged_in_callback) == expected
  
      call_args = wandb.run.log.call_args
      assert call_args[1] == {"step": 0}
  
imports: from typing import Any
  from typing import Dict
  from typing import List
  from typing import Sequence
  from typing import Tuple
  from typing import Union
  from unittest import mock
  import pytest
  import optuna
  from optuna.integration import WeightsAndBiasesCallback
label_desc: Use image node_id 8 for calling a global function with example usage: test_values_registered_on_epoch_with_logging(wandb, metric, expected) and returns: result