
    Di                        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 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)optuna_warn)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        d|  dt               y )NzArgument ``zF`` is an experimental feature. The interface can change in the future.)r   r   )option_names    Z/home/ubuntu/crypto_trading_bot/.venv/lib/python3.12/site-packages/optuna/_experimental.pywarn_experimental_argumentr       s    
k] #3 	3    c                |    t        | t              rt        | j                  d            dk7  rt	        d|  d      y )N.   z?Invalid version specification. Must follow `x.y.z` format but `z
` is given)
isinstancestrlensplit
ValueError)versions    r   _validate_versionr   (   sA    gs#s7==+='>!'CMgYV`a
 	
 (Dr   c                6    d| v r| j                  d      d   S dS )N
 )r   )	docstrings    r   _get_docstring_indentr"   /   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                 X    t        j                   d dt        d        | i |S Nz" is experimental (supported from vz*). The interface can change in the future.   )
stacklevelwarningswarnr   )argskwargs_namefuncr   s     r   wrapperz5experimental_func.<locals>.decorator.<locals>.wrapperK   s>    MM';G9 E: :#	 (((r   )r.   r   r/   r   returnr   )__doc___EXPERIMENTAL_NOTE_TEMPLATEformatr"   striptextwrapindent
__module____qualname__	functoolswraps)r1   noter9   r2   r0   namer   s   `   @r   	decoratorz$experimental_func.<locals>.decoratorA   s    <<DL*11g1>&t||4||))+hoodF.KKfT@4??+1T->->,?@			) 
	) r   )r1   Callable[FP, FT]r3   rA   r   r   r?   r@   s   `` r   experimental_funcrD   3   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                j    t        j                  n d d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_initq   sN    #/t^D E88?y A>> (  t5d5f5r   r    r%   )rK   r   r.   r   r/   r   r3   None)getattrr<   r=   setattrr4   r5   r6   r"   r7   r8   r9   )clsrN   r>   r9   rL   rM   r?   r   s       @@r   r2   z6experimental_class.<locals>.decorator.<locals>.wrapperi   s    
 %S*5N$S*5N__^,	6 -	6 C\2{{" .55'5BD*3;;7F++++-f0MMPVVCKJr   rR   r   r3   r    )rR   r2   r?   r   s     r   r@   z%experimental_class.<locals>.decoratorh   s    	> s|r   rS   rB   rC   s   `` r   experimental_classrU   [   s     g D r   )r   r   r3   rO   )r   r   r3   rO   )r!   r   r3   r   )N)r   r   r?   
str | Noner3   z.Callable[[Callable[FP, FT]], Callable[FP, FT]])r   r   r?   rV   r3   zCallable[[CT], CT])
__future__r   r<   r8   typingr   r   r   r,   optuna._warningsr   optuna.exceptionsr   collections.abcr	   typing_extensionsr
   r   r   r   r5   r   r   r"   rD   rU   rT   r   r   <module>r]      s    "        ( 1 (+	B	4B	B 
B %%
% 4%T //
/ /r   