code: def experimental_class(
      version: str,
      name: Optional[str] = None,
  ) -> "Callable[[CT], CT]":
      """Decorate class as experimental.
  
      Args:
          version: The first version that supports the target feature.
          name: The name of the feature. Defaults to the class name. Optional.
      """
  
      _validate_version(version)
  
      def decorator(cls: "CT") -> "CT":
          def wrapper(cls: "CT") -> "CT":
              """Decorates a class as experimental.
  
              This decorator is supposed to be applied to the experimental class.
              """
              _original_init = getattr(cls, "__init__")
              _original_name = getattr(cls, "__name__")
  
              @functools.wraps(_original_init)
              def wrapped_init(
                  self: Any, *args: Any, **kwargs: Any
              ) -> None:
                  warnings.warn(
                      "{} is experimental (supported from v{}). "
                      "The interface can change in the future.".format(
                          name if name is not None else _original_name,
                          version,
                      ),
                      ExperimentalWarning,
                      stacklevel=2,
                  )
  
                  _original_init(self, *args, **kwargs)
  
              setattr(cls, "__init__", wrapped_init)
  
              if cls.__doc__ is None:
                  cls.__doc__ = ""
  
              note = _EXPERIMENTAL_NOTE_TEMPLATE.format(ver=version)
              indent = _get_docstring_indent(cls.__doc__)
              cls.__doc__ = (
                  cls.__doc__.strip()
                  + textwrap.indent(note, indent)
                  + indent
              )
  
              return cls
  
          return wrapper(cls)
  
      return decorator
  
file_path: optuna/optuna/_experimental.py
imports: import functools
  import textwrap
  from typing import Any
  from typing import Callable
  from typing import Optional
  from typing import TYPE_CHECKING
  from typing import TypeVar
  import warnings
  from optuna.exceptions import ExperimentalWarning
label_desc: Use image node_id 4 for calling a global function with example usage: experimental_class(version, name) and returns: decorator, wrapper, cls