Ë
    Öš„j_2  ã                   óŠ   — d dl Z d dlZd dlZd dlZd dlmZ d dlmZ dZg d¢Z	dZ
 G d„ de«      Z G d	„ d
e«      Z	 	 dd„Zd„ Zy)é    N)Úversion)Údatez2.1.0)Ú
deprecatedÚmessage_locationÚfail_if_not_removedÚDeprecatedWarningÚUnsupportedWarningÚbottomc                   ó*   ‡ — e Zd ZdZdˆ fd„	Zd„ Zˆ xZS )r   aw  A warning class for deprecated methods

    This is a specialization of the built-in :class:`DeprecationWarning`,
    adding parameters that allow us to get information into the __str__
    that ends up being sent through the :mod:`warnings` system.
    The attributes aren't able to be retrieved after the warning gets
    raised and passed through the system as only the class--not the
    instance--and message are what gets preserved.

    :param function: The function being deprecated.
    :param deprecated_in: The version that ``function`` is deprecated in
    :param removed_in: The version or :class:`datetime.date` specifying
                       when ``function`` gets removed.
    :param details: Optional details about the deprecation. Most often
                    this will include directions on what to use instead
                    of the now deprecated code.
    c                 ój   •— || _         || _        || _        || _        t        t
        | �  ||||«       y )N)ÚfunctionÚdeprecated_inÚ
removed_inÚdetailsÚsuperr   Ú__init__)Úselfr   r   r   r   Ú	__class__s        €úB/var/www/html/GAP/venv/lib/python3.12/site-packages/deprecation.pyr   zDeprecatedWarning.__init__5   s<   ø€ ð !ˆŒØ*ˆÔØ$ˆŒØˆŒÜÔ Ñ/°¸-Ø0:¸Gõ	Eó    c                 óÄ  — t        j                  t        «      }| j                  |d<   | j                  rd| j                  z  |d<   | j
                  r;dj                  t        | j
                  t        «      rdnd| j
                  «      |d<   t        | j                  | j
                  | j                  g«      rd|d	<   | j                  rd
| j                  z  |d<   d|z  S )Nr   z	 as of %sr   z and will be removed {} {}ÚonÚinÚremovedú.Úperiodú %sr   zH%(function)s is deprecated%(deprecated)s%(removed)s%(period)s%(details)s)ÚcollectionsÚdefaultdictÚstrr   r   r   ÚformatÚ
isinstancer   Úanyr   ©r   Úpartss     r   Ú__str__zDeprecatedWarning.__str__@   sÌ   € ô ×'Ñ'¬Ó,ˆØ ŸM™MˆˆjÑà×ÒØ"-°×0BÑ0BÑ"BˆE�,ÑØ�?Š?Ø;×BÑBÌ:ÐVZ×VeÑVeÔgkÔKlÁ4ÐrvØCGÇ?Á?ó TˆE�)Ñä�×"Ñ" D§O¡O°T·\±\ÐBÔCØ!ˆE�(‰OØ�<Š<Ø$ t§|¡|Ñ3ˆE�)Ñð(Ø+0ñ2ð 	3r   )Ú )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r&   Ú__classcell__)r   s   @r   r   r   "   s   ø„ ñõ$	Eö3r   r   c                   ó   — e Zd ZdZd„ Zy)r	   aƒ  A warning class for methods to be removed

    This is a subclass of :class:`~deprecation.DeprecatedWarning` and is used
    to output a proper message about a function being unsupported.
    Additionally, the :func:`~deprecation.fail_if_not_removed` decorator
    will handle this warning and cause any tests to fail if the system
    under test uses code that raises this warning.
    c                 ó¶   — t        j                  t        «      }| j                  |d<   | j                  |d<   | j
                  rd| j
                  z  |d<   d|z  S )Nr   r   r   r   z9%(function)s is unsupported as of %(removed)s.%(details)s)r   r   r    r   r   r   r$   s     r   r&   zUnsupportedWarning.__str__^   sZ   € Ü×'Ñ'¬Ó,ˆØ ŸM™MˆˆjÑØŸ?™?ˆˆiÑà�<Š<Ø$ t§|¡|Ñ3ˆE�)ÑðØ!&ñ(ð 	)r   N)r(   r)   r*   r+   r&   © r   r   r	   r	   T   s   „ ñó	)r   r	   c                 ób  ‡ ‡‡‡‡— ‰ €‰�t        d«      ‚d}dŠt        ‰t        «      rt        j                  «       ‰k\  rdŠnVd}nS|rOt	        j
                  |«      }‰r|t	        j
                  ‰«      k\  rdŠn‰ r|t	        j
                  ‰ «      k\  rd}nd}t        |‰g«      Šˆ ˆˆˆˆfd„}|S )aå	  Decorate a function to signify its deprecation

    This function wraps a method that will soon be removed and does two things:
        * The docstring of the method will be modified to include a notice
          about deprecation, e.g., "Deprecated since 0.9.11. Use foo instead."
        * Raises a :class:`~deprecation.DeprecatedWarning`
          via the :mod:`warnings` module, which is a subclass of the built-in
          :class:`DeprecationWarning`. Note that built-in
          :class:`DeprecationWarning`s are ignored by default, so for users
          to be informed of said warnings they will need to enable them--see
          the :mod:`warnings` module documentation for more details.

    :param deprecated_in: The version at which the decorated method is
                          considered deprecated. This will usually be the
                          next version to be released when the decorator is
                          added. The default is **None**, which effectively
                          means immediate deprecation. If this is not
                          specified, then the `removed_in` and
                          `current_version` arguments are ignored.
    :param removed_in: The version or :class:`datetime.date` when the decorated
                       method will be removed. The default is **None**,
                       specifying that the function is not currently planned
                       to be removed.
                       Note: This parameter cannot be set to a value if
                       `deprecated_in=None`.
    :param current_version: The source of version information for the
                            currently running code. This will usually be
                            a `__version__` attribute on your library.
                            The default is `None`.
                            When `current_version=None` the automation to
                            determine if the wrapped function is actually
                            in a period of deprecation or time for removal
                            does not work, causing a
                            :class:`~deprecation.DeprecatedWarning`
                            to be raised in all cases.
    :param details: Extra details to be added to the method docstring and
                    warning. For example, the details may point users to
                    a replacement method, such as "Use the foo_bar
                    method instead". By default there are no details.
    zCCannot set removed_in to a value without also setting deprecated_inFTc                 ó2  •‡ — ‰rð‰ j                   xs d}‰rd‰z  nd‰
r$dj                  t        ‰
t        «      rdnd‰
«      nd‰rd‰z  nddœ} dj                  di |¤Ž}d}|j	                  d	d«      }t        |«      dkD  r8t        j                  |d   «      |d<   |j                  |d	«       t        d
k7  rd}|j                  ||«       |j                  |d«       dj                  |«      ‰ _         t        j                  ‰ «      ˆˆˆ ˆ	ˆ
ˆfd„«       }|S )Nr'   r   z
   This will be removed {} {}.r   r   )r   r   r   z3.. deprecated::{deprecated_in}{removed_in}{details}é   ú
Útopé   z

c                  ó˜   •— ‰	r@‰rt         }nt        } |‰j                  ‰‰‰«      }t        j                  |t
        d¬«        ‰| i |¤ŽS )Né   )ÚcategoryÚ
stacklevel)r	   r   r(   ÚwarningsÚwarnÚDeprecationWarning)
ÚargsÚkwargsÚclsÚthe_warningr   r   r   Úis_unsupportedr   Úshould_warns
       €€€€€€r   Ú_innerz5deprecated.<locals>._function_wrapper.<locals>._inner÷   sR   ø€ áÙ!Ü,‘Cä+�Cá! (×"3Ñ"3°]Ø",¨gó7�ä—‘˜kÔ4FØ)*õ,ñ ˜TÐ, VÑ,Ð,r   r/   )r+   r!   r"   r   ÚsplitÚlenÚtextwrapÚdedentÚinsertr   ÚjoinÚ	functoolsÚwraps)r   Úexisting_docstringr%   Údeprecation_noteÚlocÚstring_listrC   r   r   rA   r   rB   s   `      €€€€€r   Ú_function_wrapperz%deprecated.<locals>._function_wrapper»   sB  ù€ Ùà!)×!1Ñ!1Ò!7°RÐñ .;�E˜MÒ)Àñ NXð 7×=Ñ=ÄjÐQ[Ô]aÔFb¹dÐhlØ>HôJØ]_á'.�E˜G’O°Bñ8ˆEð!?ð !8ß8>¹ñ!HØAFñ!HÐð ˆCð -×2Ñ2°4¸Ó;ˆKä�;Ó !Ò#ô "*§¡°¸Q±Ó!@�˜A‘ð ×"Ñ" 3¨Ô-ô $ uÒ,Ø�Cð ×Ñ˜sÐ$4Ô5Ø×Ñ˜s FÔ+à!Ÿw™w {Ó3ˆHÔä	�‰˜Ó	"÷	-ð 	-ó 
#ð	-ð ˆr   )Ú	TypeErrorr"   r   Útodayr   Úparser#   )r   r   Úcurrent_versionr   Úis_deprecatedrP   rA   rB   s   `` `  @@r   r   r   j   sÁ   ü€ ðX Ð Ð!7Üð =ó >ð 	>ð €MØ€Nô
 �*œdÔ#Ü�:‰:‹<˜:Ò%Ø!‰Nà ‰MÙ	Ü!Ÿ-™-¨Ó8ˆáØ#¤w§}¡}°ZÓ'@Ò@Ø!‰NÙØ!¤W§]¡]°=Ó%AÒAØ ‰Mð ˆä�} nÐ5Ó6€K÷Jð JðV Ðr   c                 óB   ‡ — t        j                  ‰ «      ˆ fd„«       }|S )a¤  Decorate a test method to track removal of deprecated code

    This decorator catches :class:`~deprecation.UnsupportedWarning`
    warnings that occur during testing and causes unittests to fail,
    making it easier to keep track of when code should be removed.

    :raises: :class:`AssertionError` if an
             :class:`~deprecation.UnsupportedWarning`
             is raised while running the test method.
    c                  ó  •— t        j                  d¬«      5 }t        j                  d«        ‰| i |¤Ž}d d d «       D ]8  }|j                  t        k(  sŒt        ‰›dt        |j                  «      ›�«      ‚ S # 1 sw Y   ŒHxY w)NT)ÚrecordÚalwaysz) uses a function that should be removed: )r:   Úcatch_warningsÚsimplefilterr8   r	   ÚAssertionErrorr    Úmessage)r=   r>   Úcaught_warningsÚrvÚwarningÚmethods        €r   Ú
test_innerz'fail_if_not_removed.<locals>.test_inner  sŒ   ø€ ä×$Ñ$¨DÔ1ð 	)°_Ü×!Ñ! (Ô+Ù˜Ð( Ñ(ˆB÷	)ð 'ò 	6ˆGØ×ÑÔ#5Ó5Ü$âœc '§/¡/Ô2ð4ó6ð 6ð	6ð
 ˆ	÷	)ð 	)ús   ˜A=Á=B)rJ   rK   )ra   rb   s   ` r   r   r   	  s(   ø€ ô ‡_�_�VÓó
ó ð
ð Ðr   )NNNr'   )r   rJ   rF   r:   Ú	packagingr   Údatetimer   Ú__version__Ú__all__r   r<   r   r	   r   r   r/   r   r   ú<module>rg      s^   ðó Û Û Û å Ý à€ò6€ð Ð ô/3Ð*ô /3ôd)Ð*ô )ð, EIØó\ó~r   