Ë
    °Œj6  ã                   ób   — d Z ddlZddlZddlZ	 ddlZ G d„ de«      ZeZ	y# e$ r ddlZY Œw xY w)aà  
Parameters deprecation
======================

.. _Tantale's Blog: https://tantale.github.io/
.. _Deprecated Parameters: https://tantale.github.io/articles/deprecated_params/

This module introduces a :class:`deprecated_params` decorator to specify that one (or more)
parameter(s) are deprecated: when the user executes a function with a deprecated parameter,
he will see a warning message in the console.

The decorator is customizable, the user can specify the deprecated parameter names
and associate to each of them a message providing the reason of the deprecation.
As with the :func:`~deprecated.classic.deprecated` decorator, the user can specify
a version number (using the *version* parameter) and also define the warning message category
(a subclass of :class:`Warning`) and when to display the messages (using the *action* parameter).

The complete study concerning the implementation of this decorator is available on the `Tantale's blog`_,
on the `Deprecated Parameters`_ page.
é    Nc                   ó6   — e Zd ZdZdefd„Zd	d„Zd„ Zd„ Zd„ Z	y)
ÚDeprecatedParamszg
    Decorator used to decorate a function which at least one
    of the parameters is deprecated.
    Ú c                 óF   — i | _         || _        | j                  ||¬«       y )N)Úreason)ÚmessagesÚcategoryÚpopulate_messages)ÚselfÚparamr   r	   s       ú[/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/deprecated/params.pyÚ__init__zDeprecatedParams.__init__'   s#   € ØˆŒØ ˆŒØ×Ñ˜u¨VÐÕ4ó    c                 óà   — t        |t        «      r| j                  j                  |«       y t        |t        «      r(d}|xs |j                  |¬«      }|| j                  |<   y t        |«      ‚)Nz!'{param}' parameter is deprecated)r   )Ú
isinstanceÚdictr   ÚupdateÚstrÚformatÚ	TypeError)r   r   r   Úfmts       r   r
   z"DeprecatedParams.populate_messages,   s[   € Ü�eœTÔ"Ø�M‰M× Ñ  Õ'Ü˜œsÔ#Ø5ˆCØÒ6˜sŸz™z°˜zÓ6ˆFØ#)ˆD�M‰M˜%Ò ä˜EÓ"Ð"r   c                 óÂ   —  |j                   |i |¤Ž}t        j                  |j                  fi |j                  ¤Ž}|D �cg c]  }|| j
                  v sŒ|‘Œ c}S c c}w ©N)ÚbindÚcollectionsÚOrderedDictÚ	argumentsÚkwargsr   )r   Ú	signatureÚargsr   ÚbindingÚboundr   s          r   Úcheck_paramszDeprecatedParams.check_params6   sY   € Ø �)—.‘. $Ð1¨&Ñ1ˆÜ×'Ñ'¨×(9Ñ(9ÑL¸W¿^¹^ÑLˆÙ#(ÓC¡5˜%¨E°T·]±]Ò,B’ 5ÑCÐCùÒCs   ÁAÁAc                 óV   — |D ]$  }t        j                  || j                  d¬«       Œ& y )Né   )r	   Ú
stacklevel)ÚwarningsÚwarnr	   )r   r   Úmessages      r   Úwarn_messageszDeprecatedParams.warn_messages;   s    € ãˆGÜ�M‰M˜'¨D¯M©MÀaÖHñ  r   c                 ót   ‡ ‡‡— t        j                  ‰«      Št        j                  ‰«      ˆˆ ˆfd„«       }|S )Nc                  ó¢   •—  ‰j                   ‰g| ¢­i |¤Ž}‰j                  |D �cg c]  }‰j                  |   ‘Œ c}«        ‰| i |¤ŽS c c}w r   )r#   r*   r   )r    r   Úinvalid_paramsr   Úfr   r   s       €€€r   Úwrapperz*DeprecatedParams.__call__.<locals>.wrapperD   s[   ø€ à.˜T×.Ñ.¨yÐJ¸4ÒJÀ6ÑJˆNØ×ÑÁ.ÓQÁ.¸ §¡¨eÓ 4À.ÑQÔRÙ�dÐ%˜fÑ%Ð%ùò  Rs   §A)Úinspectr   Ú	functoolsÚwraps)r   r.   r/   r   s   `` @r   Ú__call__zDeprecatedParams.__call__@   s5   ú€ ä×%Ñ% aÓ(ˆ	ä	�‰˜Ó	õ	&ó 
ð	&ð
 ˆr   N)r   )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚDeprecationWarningr   r
   r#   r*   r3   © r   r   r   r   !   s*   „ ñð
 &(Ð2Dó 5ó
#òDò
Ió

r   r   )
r7   r   r1   r'   Úinspect2r0   ÚImportErrorÚobjectr   Údeprecated_paramsr9   r   r   Ú<module>r>      sG   ðñó( Û Û ðãô
)�vô )ð\ %Ñ øðe ò Ýðús   �" ¢	.­.