code: def test_call_after_trial_of_independent_sampler() -> None:
      independent_sampler = optuna.samplers.RandomSampler()
      with warnings.catch_warnings():
          warnings.simplefilter(
              "ignore", optuna.exceptions.ExperimentalWarning
          )
          sampler = optuna.integration.PyCmaSampler(
              independent_sampler=independent_sampler
          )
      study = optuna.create_study(sampler=sampler)
      with patch.object(
          independent_sampler,
          "after_trial",
          wraps=independent_sampler.after_trial,
      ) as mock_object:
          study.optimize(lambda _: 1.0, n_trials=1)
          assert mock_object.call_count == 1
  
imports: import math
  from typing import Any
  from typing import Dict
  from unittest.mock import call
  from unittest.mock import patch
  import warnings
  import _pytest.capture
  import pytest
  import optuna
  from optuna._imports import try_import
  from optuna.distributions import BaseDistribution
  from optuna.distributions import CategoricalDistribution
  from optuna.distributions import FloatDistribution
  from optuna.distributions import IntDistribution
  from optuna.integration.cma import _Optimizer
  from optuna.study._study_direction import StudyDirection
  from optuna.testing.distributions import UnsupportedDistribution
  from optuna.testing.trials import _create_frozen_trial
  from optuna.trial import Trial
  from optuna.trial import TrialState
label_desc: Use image node_id 9 for calling the TestPyCmaSampler obj's underlying member method code with example usage: obj.test_call_after_trial_of_independent_sampler() without return types