Viewing File: /opt/hc_python/lib/python3.12/site-packages/sentry_sdk/__pycache__/utils.cpython-312.pyc

�

h0i����.�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZmZddlmZddlmZmZmZddlmZddlmZmZmZmZmZ	ddlmZddl!Z!dd	l"m#Z#dd
l$m%Z%m&Z&m'Z'm(Z(ddl)m*Z*m+Z+m,Z,ddl-m.Z.e.rPdd
l/m0Z0m1Z1ddl-m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAddlBmCZCddl)mDZDmEZEmFZFmGZGmHZHe<d�ZIe@d�ZJeddd�ZKej�d�ZMdaNej�d�ZPeQd�ZReQd�ZSdZT	dd�d�ZUd�ZVd�ZWd�ZXd �ZYGd!�d"�ZZeZ�Z[d#�Z\d$�Z]d%�Z^d&�Z_eQd'�Z`d(�Zad�d)�ZbGd*�d+ec�ZdGd,�d-�ZeGd.�d/�Zfd0�Zgd1�Zhd2�Zid3�Zj			d�d4�Zk	d�d5�Zld6�Zmd7�Znd8�Zo					d�d9�Zp			d�d:�Zqd;�Zrd<�Zs						d�d=�Zteuevd>�Zwewrd?�Zxnd@�Zx						d�dA�Zy			d�dB�ZzdC�Z{dD�Z|dE�Z}d�dF�Z~d�dG�ZdH�Z�dI�Z�		d�dJ�Z�dK�Z�dL�Z�dM�Z�dN�Z�dO�Z�d�dP�Z�dQ�Z�dR�Z�dS�Z�dT�Z�e��\Z�Z�dUZ�dV�Z�dW�Z�e�dX�Z�GdY�dZev�Z�Gd[�d\e
�j(�Z�d]�Z�d^�Z�e
d_gd`��Z�d�da�Z�e
dbgdc��Z�d�dd�Z�de�Z�d�df�Z�dg�Z�dh�Z�di�Z�dj�Z�dk�Z�dl�Z�d�dm�Z�dn�Z�e.re;do��Z�e;dp��Z�e�fdq�Z�e#rdr�Z�nds�Z�dt�Z�	ddul�m�Z�ddvl�m�Z�dy�Z�d�dz�Z�d{�Z�e.re@d|�Z�d}�Z�d~�Z�d�Z�d��Z�d��Z�d��Z�y#e $rdZY���wxYw#e $r	dw�Z�dx�Z�Y�BwxYw)��N)�
namedtuple)�datetime�timezone)�Decimal)�partial�
partialmethod�wraps)�Real)�parse_qs�unquote�	urlencode�urlsplit�
urlunsplit)�BaseExceptionGroup)�PY37)�DEFAULT_ADD_FULL_STACK�DEFAULT_MAX_STACK_FRAMES�DEFAULT_MAX_VALUE_LENGTH�EndpointType)�	Annotated�AnnotatedValue�SENSITIVE_DATA_SUBSTITUTE)�
TYPE_CHECKING)�	FrameType�
TracebackType)�Any�Callable�cast�ContextManager�Dict�Iterator�List�NoReturn�Optional�overload�	ParamSpec�Set�Tuple�Type�TypeVar�Union)�Hub)�Event�ExcInfo�Log�Hint�Metric�P�Ri��zsentry_sdk.errorsz^[a-zA-Z0-9/+=]*$)�false�f�n�no�off�0)�true�t�y�yes�on�1i�F)�strictc�~�|�t|�j�nd}|tvry|tvry|rdSt	|�S)z�Casts an ENV variable value to boolean using the constants defined above.
    In strict mode, it may return None if the value doesn't match any of the predefined values.
    NFT)�str�lower�FALSY_ENV_VALUES�TRUTHY_ENV_VALUES�bool)�valuerA�
normalizeds   �?/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/utils.py�env_to_boolrKZsF��
(-�'8��U��!�!�#�d�J��%�%���&�&���4�*�t�E�{�*�c�P�tj|dd��jd�S)zCSerialize data into a compact JSON representation encoded as UTF-8.F)�,�:)�	allow_nan�
separators�utf-8)�json�dumps�encode)�datas rJ�
json_dumpsrWjs"���:�:�d�e�
�C�J�J�7�S�SrLc��	ttjjd�5}d}tj
dk(stj
dk(r7t
j�}|xjtjzc_t
jgd�|tj||��j�dj�jd�}ddd�|S#1swYSxYw#tt t"f$rYywxYw)Nzw+�win32�cygwin)�gitz	rev-parse�HEAD)�startupinfo�stdout�stderr�stdinrrR)�open�os�path�devnull�sys�platform�
subprocess�STARTUPINFO�dwFlags�STARTF_USESHOWWINDOW�Popen�PIPE�communicate�strip�decode�OSError�IOError�FileNotFoundError)�nullr]�revisions   rJ�get_git_revisionrups����
�"�'�'�/�/�4�
(�D��K��|�|�w�&�#�,�,�(�*B�(�4�4�6���#�#�z�'F�'F�F�#�� � �0� +�%�?�?�������q�"��������
�)�,�O�-)�,�O��
�W�/�0����s/�$C5�B8C(�C5�(C2�-C5�2C5�5D�Dc��tjjd�}|r|St�}|r|SdD]'}tjj|�}|s�%|cSy)zTry to guess a default release.�SENTRY_RELEASE)�HEROKU_SLUG_COMMIT�SOURCE_VERSION�!CODEBUILD_RESOLVED_SOURCE_VERSION�CIRCLE_SHA1�GAE_DEPLOYMENT_IDN)rb�environ�getru)�release�vars  rJ�get_default_releaser��s\���j�j�n�n�-�.�G����� �G�������*�*�.�.��%����N��rLc�H�gd�}|D]}||vs�dj|�cSy)zAReturn the SDK name including the name of the used web framework.)�django�flask�fastapi�bottle�falcon�quart�sanic�	starlette�litestar�starlite�chalice�
serverless�pyramid�tornado�aiohttp�
aws_lambda�gcp�beam�asgi�wsgizsentry.python.{}z
sentry.python)�format)�installed_integrations�framework_integrations�integrations   rJ�get_sdk_namer��s5����..���0�0�%�,�,�[�9�9�.�rLc��eZdZdZd�Zd�Zy)�CaptureInternalException�c��|S�Nr���selfs rJ�	__enter__z"CaptureInternalException.__enter__�s���rLc�(�|�|�t|||f�y)NT)�capture_internal_exception)r��tyrH�tbs    rJ�__exit__z!CaptureInternalException.__exit__�s��
�>�e�/�&��E�2��7�rLN)�__name__�
__module__�__qualname__�	__slots__r�r�r�rLrJr�r��s���I��rLr�c��tSr�)�_CAPTURE_INTERNAL_EXCEPTIONr�rLrJ�capture_internal_exceptionsr��s��&�&rLc�x�tj�j�rtj	d|��yy)z�
    Capture an exception that is likely caused by a bug in the SDK
    itself.

    These exceptions do not end up in Sentry and are just logged instead.
    zInternal error in sentry_sdk��exc_infoN)�
sentry_sdk�
get_client�	is_active�logger�errorr�s rJr�r��s/������(�(�*����3�h��G�+rLc�0�|tz
j�Sr�)�epoch�
total_seconds�rHs rJ�to_timestampr��s���E�M�(�(�*�*rLc�b�|jtj�}|jd�S)z�Formats a timestamp in RFC 3339 format.

    Any datetime objects with a non-UTC timezone are converted to UTC, so that all timestamps are formatted in UTC.
    z%Y-%m-%dT%H:%M:%S.%fZ)�
astimezoner�utc�strftime)rH�utctimes  rJ�format_timestampr��s,�����x�|�|�,�G����3�4�4rL)�+�-c�\�	tj|�}|jtj�S#ttf$rfd|vrdnd}|j	d�r|dddz}|dt
vr|dz
}|dd	|d
dz}n|dt
vr|dz
}tj||�}Y��wxYw)N�.z%Y-%m-%dT%H:%M:%S.%fz%Y-%m-%dT%H:%M:%S�Z���z+0000i����z%z���������)
r�
fromisoformat�AttributeError�
ValueError�endswith�ISO_TZ_SEPARATORS�strptimer�rr�)rH�result�timestamp_formats   rJ�datetime_from_isoformatr�s���<��'�'��.�� ���X�\�\�*�*��
�J�'�<�'*�U�l�"�8K�	��>�>�#���#�2�J��(�E���9�)�)���$���#�2�J��r�s��+�E�
�2�Y�+�
+���$���"�"�5�*:�;��<�s�6�A2B+�*B+c�\�|�tj�}nt|�}|d�d}d|iS)z+Creates a hint with the exc info filled in.Nrr�)rer��exc_info_from_errorr�s rJ�event_hint_with_exc_infor�s9�����<�<�>��&�x�0����{������!�!rLc��eZdZdZy)�BadDsnzRaised on invalid DSNs.N�r�r�r��__doc__r�rLrJr�r�"s��!rLr�c�4�eZdZdZd�Zed��Zdd�Zd�Zy)�DsnzRepresents a DSN.c�D�t|t�rt|j�|_yt	t|��}|jdvrtd|jz��|j|_|j�td��|j|_	|j�|jdk(xrdxsd|_
n|j|_
|jstd��|j|_|j|_|jj!dd	�}	tt#|j%���|_dj-|�dz|_y#t(t*f$r td
|jxsdd	dz��wxYw)N)�http�httpszUnsupported scheme %rzMissing hostnamer���PzMissing public key�/r4zInvalid project in DSN (%r)�)�
isinstancer��dict�__dict__rrC�schemer��hostname�host�port�username�
public_key�password�
secret_keyrc�rsplit�int�pop�
project_idr��	TypeError�join)r�rH�partsrcs    rJ�__init__zDsn.__init__)sT���e�S�!� ����0�D�M����U��$���<�<�0�0��0�5�<�<�?�@�@��l�l����>�>�!��+�,�,��N�N��	��:�:�����w�.�6�3�<�"�D�I��
�
�D�I��~�~��-�.�.��.�.����.�.����z�z� � ��a�(��	Q�!�#�d�h�h�j�/�2�D�O��H�H�T�N�S�(��	���I�&�	Q��6�%�*�*�:J��A�B�9O�O�P�P�	Q�s�/'E0�0/Fc�t�|j}|j|jfdvr|�d|j��}|S)zThe netloc part of a DSN.))r�r�)r�r�rO)r�r�r��r��rvs  rJ�netlocz
Dsn.netlocMs6���Y�Y���K�K����#�+I�I���	�	�*�B��	rLNc	��t|j|j|j|j|j
|j|��S)z*Returns the auth info object for this dsn.)r�r�rcr�r�r��client)�Authr�r�rcr�r�r�)r�r�s  rJ�to_authzDsn.to_authVs>����;�;�����������������
�	
rLc���|j�d|j�|jxrd|jzxsd�d|j�|j�|j
��S)N�://�@r�)r�r�r�r�rcr�r�s rJ�__str__zDsn.__str__csN��
�K�K��O�O��O�O�5��d�o�o� 5�;��;��K�K��I�I��O�O�

�	
rLr�)	r�r�r�r�r��propertyr�r�rr�rLrJr�r�&s)���")�H����
�	
rLr�c�D�eZdZdZ				dd�Zejfd�Zd�Zy)r�z,Helper object that represents the auth info.Nc	�t�||_||_||_||_||_||_||_||_yr�)r�r�rcr�r�r��versionr�)	r�r�r�r�r�r�rr�rcs	         rJr�z
Auth.__init__rs<�������	���	�$���$���$��������rLc	��|j�d|j�|j�d|j�d|j�d�	S)z'Returns the API url for storing events.rzapi/r�)r�r�rcr�rH)r��types  rJ�get_api_urlzAuth.get_api_url�s1��
�K�K��I�I��I�I��O�O��J�J�
�	
rLc��d|jfd|jfg}|j�|jd|jf�|j�|jd|jf�ddjd�|D��zS)z!Returns the auth header a string.�
sentry_key�sentry_version�
sentry_client�
sentry_secretzSentry z, c3�0K�|]\}}|�d|�����y�w)�=Nr�)�.0�keyrHs   rJ�	<genexpr>z!Auth.to_header.<locals>.<genexpr>�s����$Q�b�
��U��U�%;�b�s�)r�rr��appendr�r�r�s  rJ�	to_headerzAuth.to_header�sy���T�_�_�-�0@�$�,�,�/O�
P���;�;�"��I�I�����4�5��?�?�&��I�I�����8�9��4�9�9�$Q�b�$Q�Q�Q�QrL)N�Nr�)	r�r�r�r�r�r�ENVELOPEr
rr�rLrJr�r�os.��6����
��.�
"�
"�
�RrLr�c�:�t|dd�xs
t|dd�S)Nr�r���getattr)�clss rJ�
get_type_namer�s���3���-�O���j�$�1O�OrLc�*�t|dd�}|dvr|Sy)Nr�)N�builtins�__builtins__r)r�mods  rJ�get_type_moduler"�s!��
�#�|�T�
*�C�
�4�4��
�rLc���	|jd}|jd�ry	dD]}	|j|ry�y#ttf$rY�+wxYw#t
$rY�8wxYw)Nr�zsentry_sdk.T)�__traceback_hide__�__tracebackhide__F)�	f_globals�
startswithr��KeyError�f_locals�	Exception)�framer!�	flag_names   rJ�should_hide_framer-�s��
��o�o�j�)���>�>�-�(��)�
?�	�	��~�~�i�(��)�?���
�H�%�
��
���	��	�s � >�A�A�A�	A�Ac#�fK�|}|�)t|j�s|��|j}|��(yy�wr�)r-�tb_frame�tb_next)r��tb_s  rJ�iter_stacksr2�s1����
�C�

�/� ����.��I��k�k���/�s�,1�1c��d}d}|�0t|d�r$	|j|�}|�|j	�}|�	tj|�}|sgdgfStd||z
�}t|dz|zt|��}		|||D�
cgc]}
t|
jd�|���� }}
t||jd�|��}||dz|	D�
cgc]}
t|
jd�|���� }
}
|||
fS#ttf$rd}Y��wxYw#ttf$rgdgfcYSwxYwcc}
wcc}
w#t$rgdgfcYSwxYw)N��
get_sourcerr4z
)�
max_length)�hasattrr5�ImportErrorrq�
splitlines�	linecache�getlinesrp�max�min�len�strip_stringrn�
IndexError)�filename�linenor6�loader�module�
context_lines�source�
source_str�lower_bound�upper_bound�line�pre_context�context_line�post_contexts              rJ�get_lines_from_filerN�s����M�
�F�
��g�f�l�;�	��*�*�6�2�J��!��*�*�,�F�
�~�	 ��'�'��1�F���4��|���a��-�/�0�K��f�q�j�=�0�#�f�+�>�K�
��{�6�2�
�2��
����F�+�
�C�2�	�
�$�F�6�N�$8�$8��$@�Z�X�����
�k�:�
�:��
����F�+�
�C�:�	�
��L�,�6�6��7�W�%�	��J�	����!�	 ��t�R�<��	 ��
��

��
���4��|���sR�D�D�D;�#D1�++D;�#D6�9D;�D�D�D.�-D.�1
D;�;E�Ec��	|jj}	|jd}	|jd}|�|r|dz
}t	|||||��SgdgfS#t$rd}Y�KwxYw#t$rgdgfcYSwxYw#t$rd}Y�PwxYw)Nr��
__loader__r4)rCrD)�f_code�co_filenamer*r&rN)r+�	tb_lineno�max_value_length�abs_pathrDrCrBs       rJ�get_source_contextrV�s�����<�<�+�+�������,�������.������Q���"��f�.�v�f�
�	
��t�R�<���#���������4��|���������s3�A�A'�A;�A$�#A$�'A8�7A8�;B	�B	c�N�	t|�S#t$rt|�cYSwxYwr�)rCr*�	safe_reprr�s rJ�safe_strrYs+�� ��5�z���� ����� �s�

�$�$c�8�	t|�S#t$rYywxYw)Nz
<broken repr>)�reprr*r�s rJrXrXs#����E�{�������s�

�	�c��|r|s|S	|jd�r|dd}|jdd�d}||k(rtjj	|�St
j|j}|s|S|j|jtjd�dd�djtj�S#t$r|cYSwxYw)Nz.pycr�r�r4r�)r��splitrbrc�basenamere�modules�__file__r��sep�lstripr*)rDrU�base_module�base_module_paths    rJ�filename_for_modulerf#s����6�������V�$����}�H��l�l�3��*�1�-���&� ��7�7�#�#�H�-�-��;�;�{�3�<�<����O��~�~�.�5�5�b�f�f�a�@��C�Q�G��K�R�R��F�F�
�	
�������s�AC� C�8AC�C�Cc��t|dd�}|sd}d}n,|jj}|jj}	|jd}	|�|j}	|rtjj|�nd}
t|	|�xsd|
|xsd|	|d�}|rt|||�\|d<|d<|d<|r'dd	lm
}|t|j�d
|��|d<|S#t
$rd}	Y��wxYw#t
$rd}
Y�wxYw)
NrQr�z	<unknown>)rArU�functionrDrBrKrLrMr)�	serializeT)�is_vars�custom_repr�vars)rrQrR�co_namer&r*�f_linenorbrc�abspathrfrV�sentry_sdk.serializerrir�r))
r+rS�include_local_variables�include_source_contextrTrkrQrUrhrD�os_abs_pathr�ris
             rJ�serialize_framert;s+���U�H�d�
+�F�������<�<�+�+���<�<�'�'�������,�����N�N�	��3;�b�g�g�o�o�h�/���
(���9�A�T���+����
�B��DV��9�.�E
�A��=��2�n�-�r�.�/A��3������ �$�K�
��6�
��I��?�����������s$�C$� #C5�$C2�1C2�5D�Dc���d}g}tj�}|�8t|�s|jt	||||���|j
}|��8|j
�d|iS)NT)rqrrrT�frames)re�	_getframer-rrt�f_back�reverse)rqrrrTr%rvr6s      rJ�current_stacktracerzosp����
�F��
�
��A�
�-� ��#��M�M���,C�+A�%5�	�
�
�H�H���-��N�N���f��rLc��t|dd�S)N�errnor)�	exc_values rJ�	get_errnor~�s���9�g�t�,�,rLc��tt|dd�xst|dd�xst|��}t|dd�}t|t�r,t	|�dkDr|ddjd�|D��zz
}|S)N�messager��detail�	__notes__r�
c3�BK�|]}t|t�s�|���y�wr�)r�rC)r�notes  rJrz$get_error_message.<locals>.<genexpr>�s����#T�U�T�j��s�>S�D�U�s��)rYrr��listr>r�)r}r��notess   rJ�get_error_messager��s}����	�9�b�)�	��9�h��+�	��I���G�
�I�{�D�1�E��%���3�u�:��>��4�$�)�)�#T�U�#T�T�T�T���NrLc	��i}	|r|j�nddd�|	d<|�||	dd<|�t|�}
nd}
|
�5|	djdi�jdi�jd	|
�|�||	dd
<|dk(}|s|�||	dd<d
|	dd<|rd|	dvrd|	dd<tduxrt	|t�}|rd|	dd<t|�|	d<t
|�|	d<t|�|	d<|�
d}
d}t}d}n |d}
|d}|d}|jd�}tt|�ttdz��D��cgc]*\}}t|j|j |
|||����,}}}t#|�tkDrt%j&d��|	d<|	S|r|s|}n
t)|||�}d|i|	d<|	Scc}}w)z�
    Creates a dict that goes into the events `exception.values` list and is ingestible by Sentry.

    See the Exception Interface documentation for more details:
    https://develop.sentry.dev/sdk/event-payloads/exception/
    �genericT�r	�handled�	mechanismN�exception_id�metar|�numberrFr�	parent_id�chainedr	�is_exception_grouprDrHrqrrrTrkr4)rSrqrrrTrkr��
stacktracerv)�copyr~�
setdefaultrr�r"rr�rr~�zipr2�range�MAX_STACK_FRAMESrtr/rSr>r�removed_because_over_size_limit�merge_stack_frames)�exc_typer}r��client_optionsr�r�r�rF�
full_stack�exception_valuer|�is_root_exceptionr�rqrrrTrk�_rv�
new_framess                    rJ�!single_exception_from_error_tupler��se��$�O�%�	����I�$�+O��K� ���7C���$�^�4����)�$��������$�/�/���;�F�F��R�	
�
�*�X�u�
%�
��17���$�X�.�$��)����!6�4=���$�[�1�/8���$�V�,��V�?�;�+G�G�/8���$�V�,�+�4�7��J��%�=���=A���$�%9�:� /�� 9�O�H��+�H�5�O�F��0��;�O�G����"&��!%��3����"0�1J�"K��!/�0H�!I��)�*<�=��$�(�(��7����R��%�0@�1�0D�*E�F��G�E�B��	��K�K��l�l�$;�#9�-�#�
	
�G����6�{�%�%�)7�(V�(V��)
���%���
���J�+�F�J��O�J�)1�:�(>���%����Cs�/G�__suppress_context__c#�hK�|\}}}g}t�}|��|��t|�|vr�|||f��|j|�|jt|��|jr
|j
}n|j}|�yt|�}|}t|dd�}|�|�t|�|vr��yyyyyy�w)N�
__traceback__)	�set�idr�addr��	__cause__�__context__r	r)r�r�r}r��seen_exceptions�seen_exception_ids�causes       rJ�walk_exception_chainr�
s�����"*���)�R��� �U��
� ��%��9�
�%7�7��I�r�)�)�

�"�"�9�-��"�"�2�i�=�1��-�-�!�+�+��!�-�-���}���E�{�H��I�����6�B�)
� ��%��9�
�%7�7�&�
!�7�&�
!�s�B)B2�,B2c#�K�|��y�wr�r�r�s rJr�r�-s������s�c	��t|||||||||��	}	|	g}
|}|dz
}t|d�xr|j}|rj|xrt|d�xr|jdu}|r�|j}
t	t|
�|
t
|
dd�|||d|��\}}|
j|�ni|xrt|d�xr|jdu}|rG|j}t	t|�|t
|dd�|||d|��\}}|
j|�|xrt|d	�}|r\t|j�D]D\}}t	t|�|t
|dd�||||d
|z|��	\}}|
j|��F||
fS)z�
    Creates the list of exceptions.
    This can include chained exceptions and exceptions from an ExceptionGroup.

    See the Exception Interface documentation for more details:
    https://develop.sentry.dev/sdk/event-payloads/exception/
    )	r�r}r�r�r�r�r�rFr�r4r�r�Nr�)r�r}r�r�r�r�rFr�r��
exceptionszexceptions[%s])r�r7r�r��exceptions_from_errorr	r�extendr��	enumerater�)r�r}r�r�r�r�r�rFr��parentr��should_supress_context�exception_has_causer��child_exceptions�exception_has_content�contextr��idx�es                    rJr�r�2s���(/���
�%��!����
�F���J��I��A��L�	�	�1�2�U�y�7U�7U���
�
0��	�;�/�
0��#�#�4�/�	�
��'�'�E�/D��e����5�/�4�8�-�#�)�"�%�	0�,�\�+�
���.�/�
�
2��	�=�1�
2��%�%�T�1�	�
!��+�+�G�/D��g��!��7�O�T�:�-�#�)�$�%�	0�,�\�+�
���.�/�#�G�w�y�,�'G����	� 4� 4�5�F�C��/D��a����1�o�t�4�-�#�)�#�'�#�-�%�
0�,�\�+�
���.�/�6�
�*�%�%rLc��|\}}}tduxrt|t�}|rt|||||dd|��\}}	n6g}	t|�D]&\}}}|	j	t||||||����(|	j
�|	S)Nr)r�r}r�r�r�r�r�r�)r�r}r�r�r�r�)rr�r�r�rr�ry)
r�r�r�r�r�r}r�r�r�r�s
          rJ�exceptions_from_error_tupler��s���'��H�i��+�4�7��J��%�=���/����)����!�	
���J��
�';�H�'E�#�H�i�����1�%�'��#1�'�)�
�	
�(F������rLc�T�	t|�S#t$rt|�ddcYSwxYw)Nr4r�)rC�UnicodeDecodeErrorr[r�s rJ�	to_stringr��s1��!��5�z����!��E�{�1�R� � �!�s�

�'�'c#�K�d|vr|d��d|vr)|djd�xsdD]}d|vs�|d���d|vr;|djd�xsdD]}t|t�s�d|vs�|d���!yy�w)Nr��threads�valuesr��	exception)r~r�r�)�event�threadr�s   rJ�iter_event_stacktracesr��s������u���L�!�!��E���I�&�*�*�8�4�:��:�F��v�%��\�*�*�;��e���{�+�/�/��9�?�R�?�I��)�T�*�|�y�/H���-�-�@��s�/A;�8A;�+A;�0A;c#�K�t|�D]@}t|t�r|jxsi}|j	d�xsdD]}|����By�w)Nrvr�)r�r�rrHr~)r�r�r+s   rJ�iter_event_framesr��sO����,�U�3�
��j�.�1�#�)�)�/�R�J��^�^�H�-�3��3�E��K�4�	4�s�AAc��t|�D]@}t|t�r|jxsi}t	|jd�|||���B|S)Nrv)�in_app_exclude�in_app_include�project_root)r�r�rrH�set_in_app_in_framesr~)r�r�r�r�r�s     rJ�
handle_in_appr��sO��,�U�3�
��j�.�1�#�)�)�/�R�J���N�N�8�$�)�)�%�		
�	4��LrLc��|sy|D]�}|jd�}|��|jd�}t||�rd|d<�:t||�rd|d<�L|jd�}|��`t|�rd|d<�qt||�s�~d|d<��|S)N�in_apprDTFrU)r~�_module_in_list�_is_external_source�_is_in_project_root)rvr�r�r�r+�current_in_apprDrUs        rJr�r��s����������8�,���%�����8�$���6�>�2�"�E�(�O���6�>�2�#�E�(�O���9�9�Z�(������x�(�#�E�(�O���x��6�"�E�(�O��;�>�MrLc�f�t|t�rt|�dk(r|\}}}npt|t�rIt	|dd�}|�t|�}|}nCt
j�\}}}||ur'd}|}t|�}ntdt|�z��|||f}trtt|�}|S)N�r�z,Expected Exception object to report, got %s!)r��tupler>�
BaseExceptionrr	rer�r�rrr.)r�r�r}r�r�s     rJr�r�s����%���C��J�!�O�"'���)�R�	�E�=�	)�
�U�O�T�
2��
�>��E�{�H��I�&)�l�l�n�#�H�i����%���!�	���;���G�$�u�+�U�V�V��)�R�(�H�����*���OrLc��|D�chc]}|d|d|d|df��}}|D�cgc]}|d|d|d|df|vr|��}}|j|�|r|jdt�nd}|�|t|�|z
d}|Scc}wcc}w)zV
    Add the missing frames from full_stack to frames and return the merged list.
    rUrLrBrh�max_stack_framesN)r�r~rr>)rvr�r�r+�	frame_ids�
stackframer�r�s        rJr�r�9s������E�
�*���.�!��(�O��*��		
����%�
�$�J��z�"��~�&��x� ��z�"�	
��
�	�$��
����f��
�	���-�/G�H�
��
�#���J��2B� B� D�E�
����A��
s
�B�Bc��t|�}t|�}|r-|jdt�rt	|d|d��d}nd}ddt||||�id�|fS)	N�add_full_stackrqrT)rqrTrvr�r�)�levelr�)r�r�r~rrzr�)r�r�r��hintr�s     rJ�event_from_exceptionr�as���#�8�,�H�#�H�-�D��.�,�,�-=�?U�V�'�$2�3L�$M�+�,>�?�
���
�
�
���5��n�i����	
�	
�
�
rLc�T�|�y|sy|D]}||k(s|j|dz�s�yy)NFr�T�r')�name�items�items   rJr�r�s8���|�������4�<�4�?�?�4�#�:�6���rLc�<�|�ytjd|�du}|S)NFz [\\/](?:dist|site)-packages[\\/]��re�search)rU�external_sources  rJr�r��s0�����	�	�	�5�x�@��L���rLc�2�|�|�y|j|�ryy)NFTr�)rUr�s  rJr�r��s&����<�/�����<�(��rLc�\�|jd�d|dz
jdd��}|dzS)zd
    Truncate a UTF-8-encodable string to the last full codepoint so that it fits in max_bytes.
    rRNr��ignore)�errors�...)rUro)�string�	max_bytes�	truncateds   rJ�_truncate_by_bytesr��s8��
�
�
�g�&���Q��7�>�>�w�x�>�X�I��u��rLc�b�	t|jd��S#ttf$rYywxYw)NrR)r>rU�UnicodeEncodeErrorr�r�s rJ�_get_size_in_bytesr��s3����5�<�<��(�)�)��� 2�3����s��.�.c���|s|S|�t}t|�}t|�}|�||kDr
t||�}n|�||kDr|d|dz
dz}n|St	||xs|dd|dz
|ggd���S)Nr�r�z!limit�x)r>�rem)rH�metadata)rr�r>r�r)rHr6�	byte_size�	text_size�truncated_values     rJr?r?�s��������-�
�"�5�)�I��E�
�I����Z�!7�,�U�J�?��	�	�9�z�#9�� 0�*�q�.�1�E�9�������)�	��s�J��N�J�?�@�
��rLc�P�d}tjd|zdztjtjz�}	|j	|�j�d}t
tt|jd�dd��}|S#tttf$rYywxYw)z�
    Parses a version string into a tuple of integers.
    This uses the parsing loging from PEP 440:
    https://peps.python.org/pep-0440/#appendix-b-parsing-version-strings-with-regular-expressions
    a  # noqa: N806
        v?
        (?:
            (?:(?P<epoch>[0-9]+)!)?                           # epoch
            (?P<release>[0-9]+(?:\.[0-9]+)*)                  # release segment
            (?P<pre>                                          # pre-release
                [-_\.]?
                (?P<pre_l>(a|b|c|rc|alpha|beta|pre|preview))
                [-_\.]?
                (?P<pre_n>[0-9]+)?
            )?
            (?P<post>                                         # post release
                (?:-(?P<post_n1>[0-9]+))
                |
                (?:
                    [-_\.]?
                    (?P<post_l>post|rev|r)
                    [-_\.]?
                    (?P<post_n2>[0-9]+)?
                )
            )?
            (?P<dev>                                          # dev release
                [-_\.]?
                (?P<dev_l>dev)
                [-_\.]?
                (?P<dev_n>[0-9]+)?
            )?
        )
        (?:\+(?P<local>[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
    z^\s*z\s*$rr�Nr�)
r��compile�VERBOSE�
IGNORECASE�match�	groupdictr��mapr�r^r�r�r�)r�VERSION_PATTERN�patternr�
release_tuples     rJ�
parse_versionr�s����O�>�j�j��/�!�G�+�
�
�
�R�]�]�"��G�
��-�-��(�2�2�4�Y�?���c�#�w�}�}�S�'9�"�1�'=�>�?�
����
�z�>�2����s�A
B�B%�$B%c���	ddl}ddlm}tt	j
d|j�ddD�cgc]
}t|���c}�}|dd�r#tjdk\r|d	k\s	|d
d�ryy
		ddl}ddlm
}t|j�}|�tj!d�y|d�r|dkry
ycc}w#t$rY�WwxYw#t$rYywxYw)z�
    Returns whether gevent/eventlet have patched the stdlib in a way where thread locals are now more "correct" than contextvars.
    rN)�is_object_patchedz	a|b|rc|\.r]�	threading�local�r�r)��	�contextvars�
ContextVarFT)�is_monkey_patchedzYInternal error in Sentry SDK: Could not parse Greenlet version from greenlet.__version__.r�)rr4)�gevent�
gevent.monkeyrr�r�r^�__version__r�re�version_infor8�greenlet�eventlet.patcherrrr�r�)rr�part�
version_tuplerr�greenlet_versions       rJ�_is_contextvars_brokenr 	s��

��3��#%�8�8�L�&�:L�:L�#M�b�q�#Q�R�#Q�4�S��Y�#Q�R�
�
��[�'�2��!�!�V�+�
��0H�%�m�\�B���3�&
��6�(��)=�)=�>���#��L�L�k�
���X�&�+;�f�+D����M
S��$�
��
��"�
���
�s:�4C�C�1C�=6C�4
C�C�	C�C�	C#�"C#c� ��G�fd�d�}|S)Nc�.��eZdZd�fd�	Zdd�Zd�Zd�Zy)�1_make_threadlocal_contextvars.<locals>.ContextVarNc�R��||_||_��|_��|_yr�)�_name�_default�_local�_original_local)r�r��defaultrs   �rJr�z:_make_threadlocal_contextvars.<locals>.ContextVar.__init__Bs$����D�J�#�D�M��'�D�K�#(�7�D� rLc�L�t|jd|xs|j�S)NrH)rr'r&)r�r)s  rJr~z5_make_threadlocal_contextvars.<locals>.ContextVar.getIs���4�;�;���1I�D�M�M�J�JrLc��ttjd��}|j�}t	|j
||�||j_|S)N�@)rC�random�getrandbitsr~�setattrr(r'rH)r�rH�token�original_values    rJr�z5_make_threadlocal_contextvars.<locals>.ContextVar.setMsE����*�*�2�.�/�E�!�X�X�Z�N��D�(�(�%��@� %�D�K�K���LrLc�|�t|j|�|j_|jj|=yr�)rr(r'rHr�)r�r0s  rJ�resetz7_make_threadlocal_contextvars.<locals>.ContextVar.resetUs/�� '��(<�(<�e� D�D�K�K���$�$�-�-�e�4rLr�)r�r�r�r�r~r�r3�rs�rJrr#?s���	+�	K�	�	5rLrr�)rrs` rJ�_make_threadlocal_contextvarsr5=s���5�5�8�rLc���t�s)tjdkr	ddlm}d|fS	ddlm}d|fSddlm}dt|�fS#t
$rY�wxYw#t
$rY�-wxYw)z�
    Figure out the "right" contextvars installation to use. Returns a
    `contextvars.ContextVar`-like class with a limited API.

    See https://docs.sentry.io/platforms/python/contextvars/ for more information.
    rr)rTr4F)
r rer�aiocontextvarsrr8rrrr5)rrs  rJ�_get_contextvarsr8^s}��"�#�
���f�$�
�5��Z�'�'�

�2��Z�'�'� ��/��6�6�6���
��
���
��
�s"�	A�	A�	A�A�	A"�!A"z�

With asyncio/ASGI applications, the Sentry SDK requires a functional
installation of `contextvars` to avoid leaking scope/context data across
requests.

Please refer to https://docs.sentry.io/platforms/python/contextvars/ for more information.
c�|�d}	|jj�d|jj�d|j��S#t$rYnwxYwd\}}t	|t
�r(t
|jd�rd\}}|j}n=t|dd�xs
t|dd�}t	|t�rd\}}|j}t
|d	�r
|j}nt
|d�r|j}|�@t
|d
�r,t	|jt�r|jdz|z}||z|z}|S)zbReturn the qualified name of func. Works with regular function, lambda, partial and partialmethod.Nr�)r�r�r�)zpartial(<function �>)�_partialmethod�__partialmethod__)zpartialmethod(<function r:r�r�)�im_classr�r�r*r�rr7�funcrrr�rC)r>�
func_qualname�prefix�suffix�partial_methods     rJ�qualname_from_functionrC�s6���M�
��M�M�$�$��M�M�"�"��M�M�
�	
��
�
��
���N�F�F��$�� �W�T�Y�Y�
�%C�3�����y�y��!��'7��>�
�'��%�t�C
���n�m�4�=�N�F�F�!�&�&�D��t�^�$��)�)�
�	��z�	"��
�
�
�� ��4��&�:�d�o�o�s�+K� �O�O�c�1�M�A�M���.��7�
��s�;A�	A�Ac��t|�Sr�)rC)r>s rJ�transaction_from_functionrE�s
��!�$�'�'rL�disable_capture_eventc��eZdZdZy)�ServerlessTimeoutWarningz>Raised when a serverless method is about to reach its timeout.Nr�r�rLrJrHrH�s��H�rLrHc�,�eZdZdZ	dd�Zd�Zd�Zd�Zy)�
TimeoutThreadz�Creates a Thread which runs (sleeps) for a time duration equal to
    waiting_time and raises a custom ServerlessTimeout exception.
    Nc��tjj|�||_||_||_||_tj�|_yr�)	r�Threadr��waiting_time�configured_timeout�isolation_scope�
current_scoper-�_stop_event)r�rMrNrOrPs     rJr�zTimeoutThread.__init__�sG��	���!�!�$�'�(���"4���.���*���$�?�?�,��rLc�8�|jj�yr�)rQr�r�s rJ�stopzTimeoutThread.stop�s�������rLc��tj�}tj�}t	||j
ddd���\}}tj||��|S)NrFr�)r�r�)r�)rer�r�r�r��options�
capture_event)r�r�r�r�r�s     rJ�_capture_exceptionz TimeoutThread._capture_exception�sR���<�<�>���&�&�(��*��!�>�>�*�u�=�
���t�
	� � ��T�2��rLc��|jj|j�|jj�ryt	|j
�}||j
kr|dz}|j�{|j�otjj|j�5tjj|j�5	tdj|���tdj|���#t$rt|j!��YnwxYw	ddd�n#1swYnxYwddd��^#1swY�gxYw)Nr4zZWARNING : Function is expected to get timed out. Configured timeout duration = {} seconds.)rQ�waitrM�is_setr�rNrOrPr��scope�use_isolation_scope�	use_scoperHr�r*�reraiserW)r��integer_configured_timeouts  rJ�runzTimeoutThread.run�s.��	
�����d�/�/�0����"�"�$��%(��)@�)@�%A�"�&��(?�(?�?�)C�a�)G�&����+��0B�0B�0N��!�!�5�5�d�6J�6J�K��%�%�/�/��0B�0B�C�<�6�x��� :����'�h�o�o�*�
�
�	
��%�<���!8�!8�!:�;�<��;�D�C�C��L�K�K�sB�+*E�D:�D�D-�*D:�,D-�-D:�1	E�:E	�?E�E�NN)r�r�r�r�r�rSrWr`r�rLrJrJrJ�s"���
UY�-���
rLrJc���d}	|jd�}tj|�}|jd�}|S#t$r1}t
j
dj|��|�Yd}~|Sd}~wwxYw)zO
    Convert a string to base64, via UTF-8. Returns None on invalid input.
    N�UTF-8z"Unable to encode {orig} to base64:)�orig)rU�base64�	b64encoderor*r��warningr�)�original�
base64_string�
utf8_bytes�base64_bytes�errs     rJ�	to_base64rms���
�M�X��_�_�W�-�
��'�'�
�3��$�+�+�G�4�
�����X����;�B�B��B�Q�SV�W�W����X�s�7=�	A7�&A2�2A7c�&�d}	tj|�}|sJ�|jd�}tj|�}|jd�}|S#t$r1}tjdj|��|�Yd}~|Sd}~wwxYw)zQ
    Convert a string from base64, via UTF-8. Returns None on invalid input.
    Nrcz#Unable to decode {b64} from base64:)�b64)
�BASE64_ALPHABETrrUre�	b64decoderor*r�rgr�)ri�utf8_string�only_valid_charsrkrjrls      rJ�from_base64rt!s���
�K�

�*�0�0��?�����$�+�+�G�4���%�%�l�3�
� �'�'��0������
����1�8�8�]�8�K�S�	
�	
����
�s�AA�	B�&B�B�
Components)r�r�rc�query�fragmentc	���t|�}t|jd��}|rL|jj	d�}t|�dkDrt�dt�d|d��}n|j}n|j}|r(tt|D�cic]	}|t��c}��}	n|j}	t|j||	|j|j��}
|r|
St|
�Scc}w)zL
    Removes the authority and query parameter values from a given URL.
    T)�keep_blank_valuesrr4rOr��r�r�rvrcrw)rrrvr�r^r>rrr
rur�rcrwr)�url�remove_authority�remove_query_valuesr^�
parsed_url�query_params�netloc_partsr�r�query_string�
componentss           rJ�sanitize_urlr�:s���
�#��J��J�,�,��E�L��!�(�(�.�.�s�3���|��q� �)�)��R� ��F� �&�&�F��"�"������N��#�s�5�5��N�O�
��"�'�'���� � ���
�_�_��$�$��J�
����*�%�%��!Os�
C0�	ParsedUrl�r{rvrwc	���t|d|d��}tt|j|jd|j
d���}t
||j|j��S)z�
    Splits a URL into a url (including path), query and fragment. If sanitize is True, the query
    parameters will be sanitized to remove sensitive data. The autority (username and password)
    in the URL will always be removed.
    T)r|r}r^r�rzr�)	r�rrur�r�rcr�rvrw)r{�sanitizer~�base_urls    rJ�	parse_urlr�isn����d����J����$�$��$�$������	
��H�������$�$��rLc	�4�t|ttf�rtj|�r1t
j
dj||t|����yt|�}|dks|dkDr't
j
dj||���yy)	z�
    Checks the given sample rate to make sure it is valid type and value (a
    boolean or a number between 0 and 1, inclusive).
    z|{source} Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got {rate} of type {type}.)rF�rater	Frr4zW{source} Given sample rate is invalid. Sample rate must be between 0 and 1. Got {rate}.)rFr�T)
r�r
r�math�isnanr�rgr�r	�float)r�rFs  rJ�is_valid_sample_rater��s����d�T�7�O�,��
�
�4�0@����
K�
R�
R��D�t�D�z�
R�
�	
�
���;�D��a�x�4�!�8����e�l�l��D�
m�
�	
�
�rLc�j�|�y|D]+}|s
|ddk7r|dz
}tj||�}|s�+yy)NFr��$Tr�)r��
regex_list�substring_matching�item_matcher�matcheds     rJ�match_regex_listr��sI�����"��!�l�2�&6�#�&=��C��L��)�)�L�$�/����
#�rLc��|duxrL|jduxr<|jjduxr"|jjj|vS)zB
    Determines whether the given URL matches the Sentry DSN.
    N)�	transport�
parsed_dsnr�)r�r{s  rJ�
is_sentry_urlr��s^��	�d��	6����D�(�	6����'�'�t�3�	6�
���'�'�.�.�#�5�	rLc#��K�	ddlm}t�}|j�D]_}|jj	dd�}|��"t|�}|j��:||vs�?||jf��|j|��ay#t$rM	ddl	}n#t$rYYywxYw|jD]%}t|j�|jf���'YywxYw�w)Nr)r��Name)�	importlibr�r��
distributionsr~�_normalize_module_namerr�r8�
pkg_resources�working_setr)r��yielded�distr��normalized_namer��infos       rJ�_generate_installed_modulesr��s�����A�&��%���*�*�,�D��=�=�$�$�V�T�2�D�
��"8��">���<�<�+��w�0N�)�4�<�<�7�7��K�K��0�-���A�	� ���	��	��"�-�-�D�(����2�D�L�L�@�@�.�A�se�C �AB�B�B�##B�C �	C�B�C�	B#�C� C �"B#�#7C�C �C�C c�"�|j�Sr�)rD�r�s rJr�r��s���:�:�<�rLc�0�tjdd|�S)Nz[-_.]+r�)r��subr�s rJ�1_replace_hyphens_dots_and_underscores_with_dashesr��s���6�6�)�S�$�'�'rLc�@�t�tt��atSr�)�_installed_modulesr�r�r�rLrJ�_get_installed_modulesr��s���!�!�"=�"?�@���rLc���tt|��}t�j�D��cic]\}}t|�|��}}}|j	|�}|�yt|�Scc}}wr�)r�r�r�r�r~r)�package�normalized_packagerD�v�installed_packagesrs      rJ�package_versionr��s|��/�9�'�B���0�1�7�7�9��9�I�F�A�	:�&�A�1�D�9���!�$�$�%7�8�G������!�!��s�A(c�L�|�J�|j|ur|j|��|�r�)r��with_traceback)�tprHr�s   rJr^r^s2���������"�$��"�"�2�&�&�
�KrLc��y)z.No-op function for ensure_integration_enabled.Nr�)�_a�_ks  rJ�_no_opr�
s��	rLc��yr�r�)r��original_functions  rJ�ensure_integration_enabledr�s��	rLc��yr�r�)r�s rJr�r�s��
	rLc�\���trttttf�����fd�}|S)a�
    Ensures a given integration is enabled prior to calling a Sentry-patched function.

    The function takes as its parameters the integration that must be enabled and the original
    function that the SDK is patching. The function returns a function that takes the
    decorated (Sentry-patched) function as its parameter, and returns a function that, when
    called, checks whether the given integration is enabled. If the integration is enabled, the
    function calls the decorated, Sentry-patched function. If the integration is not enabled,
    the original function is called.

    The function also takes care of preserving the original function's signature and docstring.

    Example usage:

    ```python
    @ensure_integration_enabled(MyIntegration, my_function)
    def patch_my_function():
        with sentry_sdk.start_transaction(...):
            return my_function()
    ```
    c�j���d���fd�}�turt��|�St��|�S)Nc�j��tj�j����|i|��S�|i|��Sr�)r�r��get_integration)�args�kwargsr�r��sentry_patched_functions  ���rJ�runnerz;ensure_integration_enabled.<locals>.patcher.<locals>.runnerCs=����$�$�&�6�6�{�C�K�(�$�9�&�9�9�*�D�;�F�;�;rL)r�zP.argsr�zP.kwargs)r�r	)r�r�r�r�s` ��rJ�patcherz+ensure_integration_enabled.<locals>.patcherAs8���	<���&�1�5�0�1�&�9�9�'�u�&�'��/�/rL)rrrr2r3)r�r�r�s`` rJr�r�"s,���4�!��!�Q�$��1B�C��0��NrLc�*�tj�Sr�)�time�perf_counter_nsr�rLrJ�nanosecond_timer�Ts���#�#�%�%rLc�B�ttj�dz�S)Nge��A)r�r��perf_counterr�rLrJr�r�Zs���4�$�$�&��,�-�-rLc�*�tj�Sr�)r�r�r�rLrJ�nowr�_s������rL)�get_hub��is_module_patchedc��yr�r�r�rLrJ�get_gevent_hubr�js��rLc��y�NFr�)�mod_names rJr�r�ns��rLc�2�td�xstd�S)Nr�_threadr�r�rLrJ�	is_geventr�ts���[�)�I�->�y�-I�IrLc���|� 	|j}|j}|�||fS	t�rt	�}|�	|j
dfS	t
j�}|j}|j}|�||fS		t
j�}|j}|j}|�||fS	y#t$rY��wxYw#t$rY��wxYw#t$rY�^wxYw#t$rYywxYw)zK
    Try to get the id of the current thread, with various fall backs.
    Nra)	�identr�r�r�r��thread_identr�current_thread�main_thread)r��	thread_id�thread_name�
gevent_hubs    rJ�get_current_thread_metar�ys0����	����I� �+�+�K��$� �+�-�-�%��{�#�%�
��!�
�!�.�.��4�4�

��)�)�+���L�L�	��k�k��� ��k�)�)�!�
��&�&�(���L�L�	��k�k��� ��k�)�)�!���G�	��	��"�
��
���
��
���
���	
�sF�B1�
C�	1C�=1C�1	B=�<B=�	C�C�	C�C�	C*�)C*c�L�|tk(rt|d�r|jdvryy)N�code)rNFT)�
SystemExitr7r�)r�rHs  rJ�should_be_treated_as_errorr��s$��	�Z��G�E�6�2�u�z�z�Y�7N��rL�Tc�p�	t||�r|S		||�S#t$rY�wxYw#t$rYywxYw)z�
    Attempt to convert from an unknown type to a specific type, using the
    given function. Return None if the conversion fails, i.e. if the function
    raises an exception.
    N)r�r�r*)�convert_funcrHs  rJ�try_convertr��sR��
��e�\�*��L�+�
��E�"�"��	�
��
��
����s�
�)�	&�&�	5�5c����fd��	�|�}tj|t��S#t$rt|�cYSwxYw)z&Safely serialize to a readable string.c���t|�rH	t|dd�}t|dd�}t|dd�}|r
|r|�d|��}n|r
|r|�d|��}n|}d|�d�St|t�r*|j�D��cic]\}}|�	|���c}}St|ttf�r|D�cgc]
}�	|���c}St|d	�r`	t|�j�D��cic]\}}|jd
�s	|�	|���!}}}dt|�j�d|�d�S|S#t$rdt|�j�d�cYSwxYwcc}}wcc}wcc}}w#t$rt|�cYSwxYw)
Nr�r�r��	anonymousr�z
<function �>z
<callable r�r��<� )�callablerr*r	r�r�r�r�r�r�r7rlr'r[)
r�rD�qualnamer��	full_path�kr�r��attrs�serialize_items
         �rJr�z&safe_serialize.<locals>.serialize_item�s�����D�>�
;� ��|�T�:��"�4���>���t�Z��=���h�#)�(�!�H�:� 6�I���#)�(�!�D�6� 2�I� $�I�#�I�;�a�0�0���d�
#�59�Z�Z�\�B�\�T�Q��A�~�a�(�(�\�B�B�
��t�U�m�
,�/3�4�t�!�N�1�%�t�4�4�
�T�:�
&�
"�!%�T�
� 0� 0� 2�� 2���1��<�<��,��~�a�(�(� 2���
�4��:�.�.�/�q���q�9�9��K��#�
;�#�D��J�$7�$7�#8��:�:�
;��C��4�����
"��D�z�!�
"�sB�AD)�8E�)E�E"�$$E�E"�)"E�
E�E"�"E9�8E9)r))rSrTrCr*)rV�
serializedr�s  @rJ�safe_serializer��sB���!�F�#�D�)�
��z�z�*�c�2�2�����4�y���s�"+�A�Ac�l�|�yt|jdd�xs|djdd��S)NF�enable_logs�_experiments�rGr~�rUs rJ�has_logs_enabledr�s?���������M�5�)�	=��>�"�&�&�}�e�<��rLc�V�|�y|jd�xs|djd�S)N�before_send_logr��r~r�s rJ�get_before_send_logrs6������;�;�(�)��W�^�-D�-H�-H��.�rLc�>�|�yt|jdd��S)NF�enable_metricsTr�r�s rJ�has_metrics_enabledrs!���������,�d�3�4�4rLc�V�|�y|jd�xs|djd�S)N�before_send_metricr�rr�s rJ�get_before_send_metricr
s6������;�;�+�,����0G�0K�0K��1�rLr�)NNN)NTTNN)TTN)NNNNNN)NNrrNNra)TTF)Tr�)�rerSr:�loggingr�rbr-r�rgrerr��collectionsrrr�decimalr�	functoolsrrr	�numbersr
�urllib.parserrr
rrrrr8r��sentry_sdk._compatr�sentry_sdk.constsrrrr�sentry_sdk._typesrrr�typingr�typesrrrrrrr r!r"r#r$r%r&r'r(r)r*r+�
gevent.hubr,r-r.r/r0r1r2r3r��	getLoggerr�r�rrp�	frozensetrErFr�rKrWrur�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr"r-r2rNrVrYrXrfrtrzr~r�r�r7r*�HAS_CHAINED_EXCEPTIONSr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r?rr r5r8�HAS_REAL_CONTEXTVARSr�CONTEXTVARS_ERROR_MESSAGErCrErFrHrLrJrmrtrur�r�r�r�r�r�r�r�r�r�r�r^r�r�r�r�rr�r�rr�r�r�r�r�r�r�rrrr
r�rLrJ�<module>rsE��
�����	�
�	��
���"�'��3�3��K�K��+�
�#���S�R� ��.������&�C�C��#��A����A�	��q�!���
��	�	�.�	/�����"�*�*�1�2���B�C���B�C�����"'�
+� T��8�0!�H��7�8��'�
	H�+�

5��j�)��+�,	"�"�Z�"�F
�F
�R.R�.R�bP�
��&����+�b��8 ���4� ����
1�j!����6-�
�.������d�N!��,B�C���7�@�������d&�R���	)�X!�.��
� $�N�:%�T���<�	�	����:1�h1�h�B#7�L$4�#5� ��j���)�X(�
#�#:�;��	�y�	�C
�I�$�$�C
�L�"�,��&W�
X�
�)&�X
�{�$@�A�	��8�>
� 
�A�:�
(��"�"�	��
���������-�`�&�.�
�

�0�/�J�
0�f�����A��&+�\��5���A@������`:�
���
�s$�$K8�L�8L�L�L�L
Back to Directory File Manager