code: def test_attributes_set_on_epoch(
      wandb: mock.MagicMock, as_multirun: bool
  ) -> None:
      wandb.sdk.wandb_run.Run = mock.MagicMock
  
      expected_config: Dict[str, Any] = {"direction": ["MINIMIZE"]}
      trial_params = {"x": 1.1, "y": 2.2}
      expected_config_with_params = {**expected_config, **trial_params}
  
      study = optuna.create_study(direction="minimize")
      wandbc = WeightsAndBiasesCallback(as_multirun=as_multirun)
  
      if as_multirun:
          wandb.run = None
  
      study.enqueue_trial(trial_params)
      study.optimize(_objective_func, n_trials=1, callbacks=[wandbc])
  
      if as_multirun:
          wandb.init().config.update.assert_called_once_with(
              expected_config_with_params
          )
      else:
          wandb.run.config.update.assert_called_once_with(
              expected_config
          )
  
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 4 for calling a global function with example usage: test_attributes_set_on_epoch(wandb, as_multirun) without return types