Ë
    þÍ:j%  ã                  ó  — d dl mZ d dlZd dlZd dlmZ d dlmZ d dlmZ d dlZd dl	m
Z
 d dlmZ d dlmZ er$d d	lmZ d d
lmZ  ed«      Z ed«      Z ed«      ZdZdZdd„Zdd„Z	 	 d	 	 	 	 	 	 	 	 	 dd„Z	 	 d	 	 	 	 	 	 	 	 	 dd„Zy)é    )ÚannotationsN)ÚAny)ÚTYPE_CHECKING)ÚTypeVar)Úversion)Ú_get_docstring_indent)Ú_validate_version)ÚCallable)Ú	ParamSpecÚFTÚFPÚCTa  

.. 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}.c                ó~   — t        j                  | «      t        j                  |«      kD  rt        d| › d|› d�«      ‚y )NzŒInvalid version relationship. The deprecated version must be smaller than the removed version, but (deprecated version, removed version) = (z, z) are specified.)r   ÚparseÚ
ValueError)Úold_versionÚnew_versions     úg/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/optuna/_deprecated.pyÚ_validate_two_versionr   *   sF   € Ü‡}�}�[Ó!¤G§M¡M°+Ó$>Ò>Üðàˆ}˜B˜{˜mÐ+;ð=ó
ð 	
ð ?ó    c                óV   — dt        j                  | j                  «       d«      z   dz   S )Nz

z    ú
)ÚtextwrapÚindentÚstrip)Útexts    r   Ú_format_textr   3   s#   € Ø”H—O‘O D§J¡J£L°&Ó9Ñ9¸DÑ@Ð@r   c                ód   ‡ ‡‡‡— t        ‰ «       t        ‰«       t        ‰ ‰«       dˆ ˆˆˆfd„}|S )a5  Decorate 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                ó^  •‡ — ‰ j                   €d‰ _         t        j                  ‰‰¬«      }‰�|t        ‰«      z  }t	        ‰ j                   «      }‰ j                   j                  «       t        j                  ||«      z   |z   ‰ _         t        j                  ‰ «      dˆˆ ˆˆˆfd„«       }|S )NÚ ©Úd_verÚr_verc                 ó¬   •— t         j                  ‰�‰n‰j                  ‰‰¬«      }‰�|d‰z   z  }t        j                  |t
        d¬«        ‰| i |¤ŽS )z‚Decorates a function as deprecated.

            This decorator is supposed to be applied to the deprecated function.
            ©Únamer"   r#   ú é   ©Ú
stacklevel)Ú_DEPRECATION_WARNING_TEMPLATEÚformatÚ__name__ÚwarningsÚwarnÚFutureWarning)ÚargsÚkwargsÚmessageÚdeprecated_versionÚfuncr&   Úremoved_versionr   s      €€€€€r   Úwrapperz3deprecated_func.<locals>.decorator.<locals>.wrapperc   sd   ø€ ô 4×:Ñ:Ø"Ð.‘d°D·M±MØ(Ø%ð ;ó ˆGð
 ÐØ˜3 ™:Ñ%�Ü�M‰M˜'¤=¸QÕ?á˜Ð( Ñ(Ð(r   )r1   r   r2   r   Úreturnz'FT')
Ú__doc__Ú_DEPRECATION_NOTE_TEMPLATEr,   r   r   r   r   r   Ú	functoolsÚwraps)r5   Únoter   r7   r4   r&   r6   r   s   `   €€€€r   Ú	decoratorz"deprecated_func.<locals>.decoratorY   sž   ù€ Ø�<‰<ÐØˆDŒLä)×0Ñ0Ð7IÐQ`Ð0ÓaˆØÐØ”L Ó&Ñ&ˆDÜ& t§|¡|Ó4ˆØ—|‘|×)Ñ)Ó+¬h¯o©o¸dÀFÓ.KÑKÈfÑTˆŒä	�‰˜Ó	÷	)ð 	)ó 
ð	)ð" ˆr   )r5   ú'Callable[FP, FT]'r8   r?   ©r	   r   ©r4   r6   r&   r   r>   s   ```` r   Údeprecated_funcrB   7   s3   û€ ô< Ð(Ô)Ü�oÔ&ÜÐ,¨oÔ>÷ð ð< Ðr   c                ód   ‡ ‡‡‡— t        ‰ «       t        ‰«       t        ‰ ‰«       dˆ ˆˆˆfd„}|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                ó&   •— dˆˆˆˆfd„} || «      S )Nc                ó¬  •‡‡— t        | d«      Št        | d«      Št        j                  ‰«      dˆˆˆˆˆˆ	fd„«       }t        | d|«       | j                  €d| _        t
        j                  ‰‰¬«      }‰	�|t        ‰	«      z  }t        | j                  «      }| j                  j                  «       t        j                  ||«      z   |z   | _        | S )z|Decorates a class as deprecated.

            This decorator is supposed to be applied to the deprecated class.
            Ú__init__r-   c                ó¢   •— t         j                  ‰�‰n‰‰‰¬«      }‰	�|d‰	z   z  }t        j                  |t        d¬«        ‰| g|¢­i |¤Ž y )Nr%   r'   r(   r)   )r+   r,   r.   r/   r0   )
Úselfr1   r2   r3   Ú_original_initÚ_original_namer4   r&   r6   r   s
       €€€€€€r   Úwrapped_initzJdeprecated_class.<locals>.decorator.<locals>.wrapper.<locals>.wrapped_init¥   sg   ø€ ä7×>Ñ>Ø"&Ð"2™$¸Ø,Ø)ð ?ó �ð
 Ð#Ø˜s T™zÑ)�GÜ—‘ØÜ!Ø õñ ˜tÐ5 dÒ5¨fÓ5r   r    r!   )rH   r   r1   r   r2   r   r8   ÚNone)Úgetattrr;   r<   Úsetattrr9   r:   r,   r   r   r   r   r   )
ÚclsrK   r=   r   rI   rJ   r4   r&   r6   r   s
       @@€€€€r   r7   z4deprecated_class.<locals>.decorator.<locals>.wrapper�   sÊ   ú€ ô
 % S¨*Ó5ˆNÜ$ S¨*Ó5ˆNä�_‰_˜^Ó,÷6ñ 6ó -ð6ô  �C˜ \Ô2à�{‰{Ð"Ø �”ä-×4Ñ4Ø(°ð 5ó ˆDð ÐØœ TÓ*Ñ*�Ü*¨3¯;©;Ó7ˆFØŸ+™+×+Ñ+Ó-´·±ÀÀfÓ0MÑMÐPVÑVˆCŒKàˆJr   ©rO   ú'CT'r8   rQ   © )rO   r7   r4   r&   r6   r   s     €€€€r   r>   z#deprecated_class.<locals>.decoratorœ   s   ø€ ÷&	ð &	ñP �s‹|Ðr   rP   r@   rA   s   ```` r   Údeprecated_classrS   z   s4   û€ ô< Ð(Ô)Ü�oÔ&ÜÐ,¨oÔ>÷)ð )ðV Ðr   )r   Ústrr   rT   r8   rL   )r   rT   r8   rT   )NN)
r4   rT   r6   rT   r&   ú
str | Noner   rU   r8   z0'Callable[[Callable[FP, FT]], Callable[FP, FT]]')
r4   rT   r6   rT   r&   rU   r   rU   r8   z'Callable[[CT], CT]')Ú
__future__r   r;   r   Útypingr   r   r   r.   Ú	packagingr   Úoptuna._experimentalr   r	   Úcollections.abcr
   Útyping_extensionsr   r   r   r   r:   r+   r   r   rB   rS   rR   r   r   ú<module>r\      sê   ðÝ "ã Û Ý Ý  Ý Û å å 6Ý 2ñ Ý(å+á	�‹€BÙ	�4‹€BÙ	�‹€BðÐ ðBð ó
óAð Øð	@Øð@àð@ð ð@ð ð	@ð
 6ó@ðL Øð	MØðMàðMð ðMð ð	Mð
 ôMr   