
    -ji/                    *   S SK Jr  S SKrS SKrS SKJr  S SKJr  S SKJr  S SKrS SK	J
r
  S SKJr  S SKJr  \(       a$  S S	KJr  S S
KJr  \" S5      r\" S5      r\" S5      rSrSrSS jrSS jr  S         SS jjr  S         SS jjrg)    )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                    [         R                  " U 5      [         R                  " U5      :  a  [        SR                  X5      5      eg )NzInvalid version relationship. The deprecated version must be smaller than the removed version, but (deprecated version, removed version) = ({}, {}) are specified.)r   parse
ValueErrorformat)old_versionnew_versions     L/home/james-whalen/.local/lib/python3.13/site-packages/optuna/_deprecated.py_validate_two_versionr   *   s=    }}[!GMM+$>>9
 	
 ?    c                X    S[         R                  " U R                  5       S5      -   S-   $ )Nz

z    
)textwrapindentstrip)texts    r   _format_textr   3   s#    HOODJJL&99D@@r   c                h   ^ ^^^ [        T 5        [        T5        [        T T5        SU UUU4S jjnU$ )a  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                b  >^  T R                   c  ST l         [        R                  TTS9nTb  U[        T5      -  n[	        T R                   5      nT R                   R                  5       [        R                  " X5      -   U-   T l         [        R                  " T 5      SUU UUU4S jj5       nU$ )N d_verr_verc                    > [         R                  Tb  TOTR                  TTS9nTb  UST-   -  n[        R                  " U[
        SS9  T" U 0 UD6$ )zjDecorates a function as deprecated.

This decorator is supposed to be applied to the deprecated function.
namer#   r$       
stacklevel)_DEPRECATION_WARNING_TEMPLATEr   __name__warningswarnFutureWarning)argskwargsmessagedeprecated_versionfuncr'   removed_versionr   s      r   wrapper3deprecated_func.<locals>.decorator.<locals>.wrapperc   sd     4::".dDMM(% ; G
 3:%MM'=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   	decorator"deprecated_func.<locals>.decoratorY   s    <<DL)007IQ`0aL&&D&t||4||))+hood.KKfT			) 	) 
	)" r   )r5   'Callable[FP, FT]'r9   rA   r	   r   r4   r6   r'   r   r?   s   ```` r   deprecated_funcrD   7   s3    < ()o&,o> < r   c                h   ^ ^^^ [        T 5        [        T5        [        T T5        SU UUU4S jjnU$ )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                *   > SUUUU4S jjnU" U 5      $ )Nc                  >^^ [        U S5      m[        U S5      m[        R                  " T5      SUUUUUU	4S jj5       n[        U SU5        U R                  c  SU l        [
        R                  TTS9nT	b  U[        T	5      -  n[        U R                  5      nU R                  R                  5       [        R                  " X#5      -   U-   U l        U $ )zdDecorates a class as deprecated.

This decorator is supposed to be applied to the deprecated class.
__init__r-   c                   > [         R                  Tb  TOTTTS9nT	b  UST	-   -  n[        R                  " U[        SS9  T" U /UQ70 UD6  g )Nr&   r(   r)   r*   )r,   r   r.   r/   r0   )
selfr1   r2   r3   _original_init_original_namer4   r'   r6   r   s
       r   wrapped_initJdeprecated_class.<locals>.decorator.<locals>.wrapper.<locals>.wrapped_init   sg    7>>"&"2$,) ? 
 #sTz)G!  t5d5f5r   r!   r"   )rJ   r   r1   r   r2   r   r9   None)getattrr<   r=   setattrr:   r;   r   r   r   r   r   r   )
clsrM   r>   r   rK   rL   r4   r'   r6   r   s
       @@r   r7   4deprecated_class.<locals>.decorator.<locals>.wrapper   s    
 %S*5N$S*5N__^,6 6 -6  C\2{{" -44( 5 D T***3;;7F++++-0MMPVVCKJr   rR   'CT'r9   rU    )rR   r7   r4   r'   r6   r   s     r   r?   #deprecated_class.<locals>.decorator   s    &	 &	P s|r   rT   rB   rC   s   ```` r   deprecated_classrX   z   s4    < ()o&,o>) )V r   )r   strr   rY   r9   rO   )r   rY   r9   rY   )NN)
r4   rY   r6   rY   r'   
str | Noner   rZ   r9   z0'Callable[[Callable[FP, FT]], Callable[FP, FT]]')
r4   rY   r6   rY   r'   rZ   r   rZ   r9   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   rD   rX   rV   r   r   <module>ra      s    "         6 2 (+	B	4B	B B 
A 	@@@ @ 	@
 6@L 	MMM M 	M
 Mr   