L i/ddlmZddlZddlZddlmZddlmZddlmZddlZddl m Z ddl m Z ddl m Z er$dd lmZdd lmZed Zed Zed ZdZdZddZddZ d ddZ d ddZy)) annotationsN)Any) TYPE_CHECKING)TypeVar)version)_get_docstring_indent)_validate_version)Callable) ParamSpecFTFPCTa .. warning:: Deprecated in v{d_ver}. This feature will be removed in the future. The removal of this feature is currently scheduled for v{r_ver}, but this schedule is subject to change. See https://github.com/optuna/optuna/releases/tag/v{d_ver}. z{name} has been deprecated in v{d_ver}. This feature will be removed in v{r_ver}. See https://github.com/optuna/optuna/releases/tag/v{d_ver}.ctj|tj|kDrtdj||y)NzInvalid version relationship. The deprecated version must be smaller than the removed version, but (deprecated version, removed version) = ({}, {}) are specified.)rparse ValueErrorformat) old_version new_versions X/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/optuna/_deprecated.py_validate_two_versionr*s?}}[!GMM+$>>  [9  ?cVdtj|jdzdzS)Nz z  )textwrapindentstrip)texts r _format_textr3s# HOODJJL&9 9D @@rcdtttdfd }|S)a5Decorate function as deprecated. Args: deprecated_version: The version in which the target feature is deprecated. removed_version: The version in which the target feature will be removed. name: The name of the feature. Defaults to the function name. Optional. text: The additional text for the deprecation note. The default note is build using specified ``deprecated_version`` and ``removed_version``. If you want to provide additional information, please specify this argument yourself. .. note:: The default deprecation note is as follows: "Deprecated in v{d_ver}. This feature will be removed in the future. The removal of this feature is currently scheduled for v{r_ver}, but this schedule is subject to change. See https://github.com/optuna/optuna/releases/tag/v{d_ver}." .. note:: The specified text is concatenated after the default deprecation note. c^jd_tj}|tz }t j}jj t j||z|z_tjdfd }|S)Nd_verr_verctjn j}|dzz }tj|t d|i|S)zDecorates a function as deprecated. This decorator is supposed to be applied to the deprecated function. namer#r$  stacklevel)_DEPRECATION_WARNING_TEMPLATEr__name__warningswarn FutureWarning)argskwargsmessagedeprecated_versionfuncr'removed_versionrs rwrapperz3deprecated_func..decorator..wrappercsd4::".dDMM(%;G 3:% MM'=Q ?(( (r)r1rr2rreturnz'FT') __doc___DEPRECATION_NOTE_TEMPLATErrrrrr functoolswraps)r5noterr7r4r'r6rs` r decoratorz"deprecated_func..decoratorYs << DL)007IQ`0a   L& &D&t||4||))+hoodF.KKfT   ) )  )"r)r5'Callable[FP, FT]'r8r?r rr4r6r'rr>s```` rdeprecated_funcrB7s3<()o&,o>< rcdtttdfd }|S)a/Decorate class as deprecated. Args: deprecated_version: The version in which the target feature is deprecated. removed_version: The version in which the target feature will be removed. name: The name of the feature. Defaults to the class name. Optional. text: The additional text for the deprecation note. The default note is build using specified ``deprecated_version`` and ``removed_version``. If you want to provide additional information, please specify this argument yourself. .. note:: The default deprecation note is as follows: "Deprecated in v{d_ver}. This feature will be removed in the future. The removal of this feature is currently scheduled for v{r_ver}, but this schedule is subject to change. See https://github.com/optuna/optuna/releases/tag/v{d_ver}." .. note:: The specified text is concatenated after the default deprecation note. c&dfd }||S)Nct|dt|dtjd fd }t|d||jd|_t j } |t z }t|j}|jjtj||z|z|_|S)z|Decorates a class as deprecated. This decorator is supposed to be applied to the deprecated class. __init__r-ctjn} |d zz }tj|td|g|i|y)Nr&r(r)r*)r,rr.r/r0) selfr1r2r3_original_init_original_namer4r'r6rs r wrapped_initzJdeprecated_class..decorator..wrapper..wrapped_initsg7>>"&"2$,)? #sTz)G !  t5d5f5rr!r")rHrr1rr2rr8None) getattrr;r<setattrr9r:rrrrrr) clsrKr=rrIrJr4r'r6rs @@rr7z4deprecated_class..decorator..wrappers %S*5N$S*5N __^ , 6 6- 6 C\ 2{{"  -44(5D T***3;;7F++++-f0MMPVVCKJrrO'CT'r8rQ)rOr7r4r'r6rs rr>z#deprecated_class..decorators& & Ps|rrPr@rAs```` rdeprecated_classrSzs4<()o&,o>))V r)rstrrrTr8rL)rrTr8rT)NN) r4rTr6rTr' str | NonerrUr8z0'Callable[[Callable[FP, FT]], Callable[FP, FT]]') r4rTr6rTr'rUrrUr8z'Callable[[CT], CT]') __future__rr;rtypingrrrr. packagingroptuna._experimentalrr collections.abcr typing_extensionsr r r rr:r,rrrBrSrRrrr\s" 62(+ B 4B BB A @@@ @  @ 6 @L MMM M  M  Mr