
    j                       d dl mZ d dlZ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 dlmZ ddlmZ ej        r ej        dej        	          Zd
ZdZdZd)dZ e            Zd*dZ e            Zd Zd Zd+dZd,dZd-dZd.dZ  G d de!          Z"d,dZ#d/dZ$ G d  d!e!          Z%d,d"Z&d/d#Z'ej        r G d$ d%ej(                  Z)ne*Z)d0d'Z+d( Z,dS )1    )annotationsN)wraps)isclass)warn   )RUST_AVAILABLE_FuncT)boundneo4jz5.15.0Freturnt.Dict[str, str]c                    d } d}t           r|dz  }dt           t          j                    pd dt          j                    pd dt          j                    pd | d	 | t          j                   t          j                     d | t          j	        j                   d
d
                    t          j                               dt          j                     ddS )Nc                     dj         |  S )Nz{}.{}.{}-{}-{})format)version_infos    U/lsinfo/ai/hellotax_ai/base_platform/venv/lib/python3.11/site-packages/neo4j/_meta.pyformat_version_infoz0_compute_bolt_agent.<locals>.format_version_info*   s    &&55    Pythonz-Rustzneo4j-python/Unknown unknownz; / (z, z) [])productplatformlanguagelanguage_details)r   versionr   systemreleasemachinesysr   python_implementationimplementationjoinpython_buildpython_compiler)r   r   s     r   _compute_bolt_agentr*   )   s+   6 6 6 H G -7,,  -I 1 1!!.Y1 1!!.Y1 1  II"5"5c6F"G"GII-// . .""3#5#=>>. .		(/1122. . (**. . .  r   strc                 X    t           d          dt           d          dt          j         dS )Nr   r   r   r   ))BOLT_AGENT_DICTr$   r    r   r   _compute_user_agentr0   C   s?    y)    z*         !r   c                     t           S )z_ Obtain the default user agent string sent to the server after
    a successful handshake.
    )
USER_AGENTr/   r   r   get_user_agentr3   O   s
     r   c                    | S Nr/   )xs    r   _idr7   V   s    Hr   _ t.Callable[[t.Callable], _FuncT]c                    t           S r5   )r7   )r8   s    r   copy_signaturer;   Z   s    Jr   c                :    t          | t          |dz              d S Nr   category
stacklevel)r   DeprecationWarningmessagestack_levels     r   deprecation_warnrE   ^   s"    -+/JJJJJJr   rC   t.Callable[[_FuncT], _FuncT]c                ,    t          | t                    S )z Decorator for deprecating functions and methods.

    ::

        @deprecated("'foo' has been deprecated in favour of 'bar'")
        def foo(x):
            pass

    )_make_warning_decoratorrE   rC   s    r   
deprecatedrJ   b   s     #7,<===r   c                B      fd}t          j        t          |          S )Nc                N    t           t                    |                     S r5   )propertyrJ   )frC   s    r   	decoratorz&deprecated_property.<locals>.decoratorp   s$    +
7++A..///r   )tcastrM   )rC   rO   s   ` r   deprecated_propertyrR   o   s.    0 0 0 0 06(I&&&r   c                      e Zd ZdZdS )ExperimentalWarningz Base class for warnings about experimental features.

    .. deprecated:: 5.8
        we now use "preview" instead of "experimental":
        :class:`.PreviewWarning`.
    N__name__
__module____qualname____doc__r/   r   r   rT   rT   u   s           r   rT   c                :    t          | t          |dz              d S r=   )r   rT   rB   s     r   experimental_warnr[   ~   s"    .;?KKKKKKr   c                ,    t          | t                    S )a9   Decorator for tagging experimental functions and methods.

    ::

        @experimental("'foo' is an experimental function and may be "
                      "removed in a future release")
        def foo(x):
            pass

    .. deprecated:: 5.8
        we now use "preview" instead of "experimental".
    )rH   r[   rI   s    r   experimentalr]      s     #7,=>>>r   c                      e Zd ZdZdS )PreviewWarningzA driver feature in preview has been used.

    It might be changed without following the deprecation policy.
    See also https://github.com/neo4j/neo4j-python-driver/wiki/preview-features
    NrU   r/   r   r   r_   r_      s           r   r_   c                D    | dz  } t          | t          |dz              d S )Nz It might be changed without following the deprecation policy. See also https://github.com/neo4j/neo4j-python-driver/wiki/preview-features.r   r>   )r   r_   rB   s     r   preview_warnra      s3    	NG
 	>kAoFFFFFFr   c                ,    t          | t                    S )z
    Decorator for tagging preview functions and methods.

        @preview("foo is a preview.")
        def foo(x):
            pass
    )rH   ra   rI   s    r   previewrc      s     #7L999r   c                      e Zd Zd
ddZd	S )_WarningFuncr   rC   r+   rD   intr   Nonec                    d S r5   r/   )selfrC   rD   s      r   __call__z_WarningFunc.__call__   s    Cr   Nr   )rC   r+   rD   rf   r   rg   )rV   rW   rX   rj   r/   r   r   re   re      s-        	 	 	 	 	 	 	r   re   warning_funcc                      fd}|S )Nc                    t          j                   r%t                      fd            } |_        |S t	                     rdt           d          rE j        t                    fd            }fd}| _        t          |           _         S t          d          t                      fd            } |_        |S )Nc                 >   K    d            | i | d {V S N   )rD   r/   argskwargsrN   rC   rl   s     r   innerz9_make_warning_decorator.<locals>.decorator.<locals>.inner   sC      W!4444Q//////////r   __init__c                6     d            | g|R i |S rp   r/   )ri   rs   rt   rC   original_initrl   s      r   ru   z9_make_warning_decorator.<locals>.decorator.<locals>.inner   s8     La8888(=???????r   c                B     | j         | g|R i |} |g|R i | |S r5   )__new__)clsrs   rt   objrx   s       r   _without_warningzD_make_warning_decorator.<locals>.decorator.<locals>._without_warning   sI    %#+c;D;;;F;;C!M#7777777Jr   z&Cannot decorate class without __init__c                 .     d            | i |S rp   r/   rr   s     r   ru   z9_make_warning_decorator.<locals>.decorator.<locals>.inner   s-    W!4444q$)&)))r   )	asyncioiscoroutinefunctionr   r}   r   hasattrrv   classmethod	TypeError)rN   ru   r}   rx   rC   rl   s   `  @r   rO   z*_make_warning_decorator.<locals>.decorator   sO   &q)) 	1XX0 0 0 0 0 0 X0 &'E"L1:: 	q*%%  !
}%%@ @ @ @ @ @ &%@    
 #
%01A%B%B"8   1XX* * * * * * X* &'E"Lr   r/   )rC   rl   rO   s   `` r   rH   rH      s+    $ $ $ $ $ $L r   c                    d| d}t          j        |           }|r0|dz  }|d                    |                                          z  }n|dz  }t	          |t
          d|            d S )Nz	Unclosed .z.
Object allocated at (most recent call last):

z;
Enable tracemalloc to get the object allocation traceback.rq   )r@   source)tracemallocget_object_tracebackr'   r   r   ResourceWarning)r|   msgtraces      r   unclosed_resource_warnr      s~    
c


C,S11E NAAtyy(((MMo!C888888r   )r   r   )r   r+   )r8   r	   r   r9   rk   )rC   r+   r   rF   )rC   r+   )r   rF   )rC   r+   rl   re   r   rF   )-
__future__r   r   r   r$   r   typingrP   	functoolsr   inspectr   warningsr   _codec.packstreamr   TYPE_CHECKINGTypeVarCallabler	   packager    deprecated_packager*   r.   r0   r2   r3   r7   r;   rE   rJ   rR   WarningrT   r[   r]   r_   ra   rc   Protocolre   objectrH   r   r/   r   r   <module>r      s  " # " " " " "   



                           - - - - - - ? 3QYxqz222F 
    . &%''! ! ! ! ! ""
       K K K K
> 
> 
> 
>' ' ' '    '   L L L L? ? ? ?     W   G G G G: : : : ?     qz     L* * * *Z9 9 9 9 9r   