
    (^i                        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
 er$d dlmZ d dlmZ  ed	      Z ed
      Z ed      ZdZddZddZddZ	 d	 	 	 	 	 ddZ	 d	 	 	 	 	 ddZy)    )annotationsN)Any)TYPE_CHECKING)TypeVar)ExperimentalWarning)Callable)	ParamSpecFTFPCTz

.. note::
    Added in v{ver} as an experimental feature. The interface may change in newer versions
    without prior notice. See https://github.com/optuna/optuna/releases/tag/v{ver}.
c                @    t        j                  d|  dt               y )NzArgument ``zF`` is an experimental feature. The interface can change in the future.)warningswarnr   )option_names    U/var/www/html/hubwallet-dev/venv/lib/python3.12/site-packages/optuna/_experimental.pywarn_experimental_argumentr      s"    MM
k] #3 	3    c                    t        | t              rt        | j                  d            dk7  rt	        dj                  |             y )N.   zKInvalid version specification. Must follow `x.y.z` format but `{}` is given)
isinstancestrlensplit
ValueErrorformat)versions    r   _validate_versionr   '   sE    gs#s7==+='>!'CY``
 	
 (Dr   c                6    d| v r| j                  d      d   S dS )N
 )r   )	docstrings    r   _get_docstring_indentr$   0   s"    (,	(99??4 $ArAr   c                .     t                d fd}|S )a  Decorate function as experimental.

    Args:
        version: The first version that supports the target feature.
        name: The name of the feature. Defaults to fully qualified name of
        the function, i.e. `f"{func.__module__}.{func.__qualname__}"`. Optional.
    c                x     j                   d _         t        j                        }t         j                         } j                   j	                         t        j                  ||      z   |z    _         xs  j                   d j                   t        j                         d fd       }|S )Nr"   verr   c                 l    t        j                  dj                        t        d        | i |S NzP{} is experimental (supported from v{}). The interface can change in the future.   )
stacklevelr   r   r   r   )argskwargs_namefuncr   s     r   wrapperz5experimental_func.<locals>.decorator.<locals>.wrapperL   s8    MM::@&:P#	 (((r   )r.   r   r/   r   returnr
   )__doc___EXPERIMENTAL_NOTE_TEMPLATEr   r$   striptextwrapindent
__module____qualname__	functoolswraps)r1   noter8   r2   r0   namer   s   `   @r   	decoratorz$experimental_func.<locals>.decoratorB   s    <<DL*11g1>&t||4||))+hoodF.KKfT@4??+1T->->,?@			) 
	) r   )r1   Callable[FP, FT]r3   r@   r   r   r>   r?   s   `` r   experimental_funcrC   4   s     g. r   c                .     t                d fd}|S )zDecorate 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.
    c                "    dfd} ||       S )Nc                   t        | d      t        | d      t        j                        dfd       }t        | d|       | j                  d| _        t
        j                        }t        | j                        }| j                  j                         t        j                  ||      z   |z   | _        | S )zDecorates a class as experimental.

            This decorator is supposed to be applied to the experimental class.
            __init____name__c                ~    t        j                  dj                  n      t        d        | g|i | y r*   r-   )selfr.   r/   _original_init_original_namer>   r   s      r   wrapped_initzLexperimental_class.<locals>.decorator.<locals>.wrapper.<locals>.wrapped_initr   sF    >>Df $ 0ng? (  t5d5f5r   r"   r'   )rJ   r   r.   r   r/   r   r3   None)getattrr;   r<   setattrr4   r5   r   r$   r6   r7   r8   )clsrM   r=   r8   rK   rL   r>   r   s       @@r   r2   z6experimental_class.<locals>.decorator.<locals>.wrapperj   s    
 %S*5N$S*5N__^,
6 -
6 C\2{{" .55'5BD*3;;7F++++-f0MMPVVCKJr   rQ   r   r3   r    )rQ   r2   r>   r   s     r   r?   z%experimental_class.<locals>.decoratori   s    	@ s|r   rR   rA   rB   s   `` r   experimental_classrT   \   s     g!F r   )r   r   r3   rN   )r   r   r3   rN   )r#   r   r3   r   )N)r   r   r>   
str | Noner3   z.Callable[[Callable[FP, FT]], Callable[FP, FT]])r   r   r>   rU   r3   zCallable[[CT], CT])
__future__r   r;   r7   typingr   r   r   r   optuna.exceptionsr   collections.abcr   typing_extensionsr	   r
   r   r   r5   r   r   r$   rC   rT   rS   r   r   <module>r[      s    "        1 (+	B	4B	B 
B %%
% 4%T 00
0 0r   