code: def test_deprecation_class_decorator_name() -> None:
      name = "foo"
      decorator_deprecation = _deprecated.deprecated_class(
          "1.1.0", "3.0.0", name=name
      )
      decorated_sample = decorator_deprecation(_Sample)
  
      with pytest.warns(FutureWarning) as record:
          decorated_sample("a", "b", "c")
  
      assert isinstance(record.list[0].message, Warning)
      assert name in record.list[0].message.args[0]
  
file_path: optuna/tests/test_deprecated.py
imports: from typing import Any
  from typing import Optional
  import pytest
  from optuna import _deprecated
label_desc: Use image node_id 5 for calling a global function with example usage: test_deprecation_class_decorator_name() without return types