o
    }oim                     @  sl   U d dl mZ d dlZd dlmZ d dlZd dlZeee	 j
ej Zded< edfdddZdgZdS )    )annotationsN)Pathstr_OPTUNA_MODULE_ROOT   messagecategorytype[Warning]
stacklevelintreturnNonec                 C  s:   t jdkrtj| ||tfd dS tj| ||d d dS )a  
    Wrapper for :func:`warnings.warn` that hides internal Optuna stack frames (for Python 3.12+).

    Behavior:
        - Python 3.12+:
            Uses `skip_file_prefixes` so that warnings appear to originate
            from the user's calling code rather than inside Optuna.
        - Python <3.12:
            This function behaves exactly the same as calling `warnings.warn`
            directly, with no stack frame suppression.
    )      )r   r
   skip_file_prefixesr   )r
   N)sysversion_infowarningswarnr   )r   r   r
    r   D/home/ubuntu/.local/lib/python3.10/site-packages/optuna/_warnings.pyoptuna_warn   s   

r   )r   r   r   r	   r
   r   r   r   )
__future__r   ospathlibr   r   r   r   __file__resolveparentsepr   __annotations__UserWarningr   __all__r   r   r   r   <module>   s     
