code: def test_call_after_trial_of_base_sampler() -> None:
      base_sampler = RandomSampler()
      with warnings.catch_warnings():
          warnings.simplefilter(
              "ignore", optuna.exceptions.ExperimentalWarning
          )
          sampler = PartialFixedSampler(
              fixed_params={}, base_sampler=base_sampler
          )
      study = optuna.create_study(sampler=sampler)
      with patch.object(
          base_sampler, "after_trial", wraps=base_sampler.after_trial
      ) as mock_object:
          study.optimize(lambda _: 1.0, n_trials=1)
          assert mock_object.call_count == 1
  
file_path: optuna/tests/samplers_tests/test_partial_fixed.py
imports: from unittest.mock import patch
  import warnings
  import pytest
  import optuna
  from optuna.samplers import PartialFixedSampler
  from optuna.samplers import RandomSampler
  from optuna.trial import Trial
label_desc: Use image node_id 6 for calling a global function with example usage: test_call_after_trial_of_base_sampler() without return types