bgTddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddl m Z ddlmZddlmZ ddlmZddlmZddlmZdd lmZdd lmZn)#e$r!ddlmZddlmZddlmZdd lmZdd lmZYnwxYw dd lmZn #e$rdZYnwxYwdd lmZdd lm Z  ddlm!Z!dZ"n #e$rdZ"YnwxYwddl#Z#ddl$m%Z%m&Z&m'Z'm(Z(m)Z)mZddl*m+Z+ddl,m-Z-e+r*ddl.m/Z/m0Z0ddl1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;mZ>edddZ?ej@dZAejBdZCdZDdZEdZFdZGdZHGd d!eIZJeJZKd"ZLd#ZMd$ZNd%ZOdjd&ZPGd'd(eQZRe(Gd)d*eIZSGd+d,eIZTGd-d.eIZUe+rdd/l1mVZVeVd0ZWeZeefegd?Zhehrd@ZindAZi dodBZj dpdCZkdDZldEZmdFZndkdGZodjdHZpdIZq dpdJZrdKZsdLZtdMZudjdNZvdOZwdPZxdQZyey\ZzZ{dRZ|dSZ}dTZ~e{dUZGdVdWegZGdXdYe jZdZZd[Ze d\gd]Zdqd^Ze d_gd`ZdrdaZdbZdsdcZddZe'rdeZn e&rdfZndgZe%rdhZdSdiZdS)tN) namedtuple)copy)Decimal)Real)parse_qs)unquote) urlencode)urlsplit) urlunsplit)BaseExceptionGroup)datetime)partial) partialmethodTF)PY2PY33PY37implements_str text_typeurlparse) TYPE_CHECKING)DEFAULT_MAX_VALUE_LENGTH) FrameType TracebackType) AnyCallableContextManagerDictIteratorListOptionalSetTupleTypeUnion) EndpointTypeExcInfoizsentry_sdk.errorsz^[a-zA-Z0-9/+=]*$z [Filtered]cVtj|dddS)zCSerialize data into a compact JSON representation encoded as UTF-8.F),:) allow_nan separatorsutf-8)jsondumpsencode)datas G/opt/cloudlinux/venv/lib64/python3.11/site-packages/sentry_sdk/utils.py json_dumpsr3Us) :de C C C J J7 S SScdSNr7r4r2_get_debug_hubr8[s  Dr4c$tjd}|r|Sttjjd5} t jgdt j|| d d}n#ttf$rYnwxYw|r|cdddS dddn #1swxYwYdD]'}tj|}|r|cS(dS) zTry to guess a default release.SENTRY_RELEASEzw+)gitz rev-parseHEAD)stdoutstderrstdinrr-N)HEROKU_SLUG_COMMITSOURCE_VERSION!CODEBUILD_RESOLVED_SOURCE_VERSION CIRCLE_SHA1GAE_DEPLOYMENT_ID)osenvirongetopenpathdevnull subprocessPopenPIPE communicatestripdecodeOSErrorIOError)releasenullvars r2get_default_releaserVasjnn-..G bgot $ $  000%?  q " G!    D   #  !&  *..%%  NNN  4s7CA!B'&C'B;8C:B;;CC"CcNgd}|D]}||vrd|cSdS)zAReturn the SDK name including the name of the used web framework.)djangoflaskfastapibottlefalconquartsanic starlettechalice serverlesspyramidtornadoaiohttp aws_lambdagcpbeamasgiwsgizsentry.python.{}z sentry.python)format)installed_integrationsframework_integrations integrations r2 get_sdk_namernsW *.:: 0 0 0%,,[99 9 9 9 1 ?r4ceZdZdZdZdZdS)CaptureInternalExceptionr7c|Sr6r7selfs r2 __enter__z"CaptureInternalException.__enter__s r4c2||t|||fdS)NT)capture_internal_exception)rstyvaluetbs r2__exit__z!CaptureInternalException.__exit__s% >e/ &E2 7 7 7tr4N)__name__ __module__ __qualname__ __slots__rtrzr7r4r2rprps7Ir4rpctSr6)_CAPTURE_INTERNAL_EXCEPTIONr7r4r2capture_internal_exceptionsrs &&r4cTt}|||dSdSr6)r8_capture_internal_exception)exc_infohubs r2rvrvs3   C  ''11111r4c:|tz Sr6)epoch total_secondsrxs r2 to_timestamprs EM ( ( * **r4c,|dS)Nz%Y-%m-%dT%H:%M:%S.%fZ)strftimers r2format_timestamprs >>1 2 22r4ch|tj}nt|}|dd}d|iS)z+Creates a hint with the exc info filled in.Nrr)sysrexc_info_from_errorrs r2event_hint_with_exc_infors><>>&x00{  !!r4ceZdZdZdS)BadDsnzRaised on invalid DSNs.Nr{r|r}__doc__r7r4r2rrs!!!!r4rc<eZdZdZdZedZddZdZdS)DsnzRepresents a DSN.c6t|trt|j|_dSt jt |}|jdvrtd|jz|j|_|j td|j |_ |j |jdkrdpd|_ n |j |_ |j std|j |_ |j|_|jdd } t t%||_n6#t*t,f$r"td |jpd d dzwxYwd|dz|_dS) N)httphttpszUnsupported scheme %rzMissing hostnamerPzMissing public key/r'zInvalid project in DSN (%r)) isinstancerdict__dict__rr rschemerhostnamehostportusername public_keypassword secret_keyrIrsplitintpop project_id ValueError TypeErrorjoin)rsrxpartsrIs r2__init__z Dsn.__init__s eS ! !  00DM F!)E"2"233 <0 0 005<?@@ @l > !+,, ,N :  w.63<"DII DI~ /-.. ...z  a(( Q'DHHJJ88DOOI& Q Q Q6%*:JABB9OOPP P QHHTNNS( s 3E3E9cL|j}|j|jfdvr |d|j}|S)zThe netloc part of a DSN.))rr)rrr*)rrrrsrvs r2netlocz Dsn.netloc s7Y K #+I I IBB *B r4Nc jt|j|j|j|j|j|j|S)z*Returns the auth info object for this dsn.)rrrIrrrclient)AuthrrrIrrr)rsrs r2to_authz Dsn.to_auths<;    r4cv|jd|j|jr d|jzpdd|j|j|jS)N://@r)rrrrrIrrrs r2__str__z Dsn.__str__ sO KKK OO O 5do 5 ; ; ; KK II OO   r4r6) r{r|r}rrpropertyrrrr7r4r2rrsh")")")HX           r4rcHeZdZdZ d dZedZ d dZd ZdS) rz,Helper object that represents the auth info.Nrc v||_||_||_||_||_||_||_||_dSr6)rrrIrrrversionr) rsrrrrrrrrIs r2rz Auth.__init__/s@   $$$  r4c.|dS)z^Returns the API url for storing events. Deprecated: use get_api_url instead. store)type) get_api_urlrrs r2 store_api_urlzAuth.store_api_urlDsW---r4rc J|jd|j|jd|jd|d S)z'Returns the API url for storing events.rzapi/r)rrrIr)rsrs r2rzAuth.get_api_urlMs7 KKK II III OOO DD   r4cd|jfd|jfg}|j|d|jf|j|d|jfddd|DzS) z!Returns the auth header a string. sentry_keysentry_versionN sentry_client sentry_secretzSentry z, c3*K|]\}}|d|VdS)=Nr7).0keyrxs r2 z!Auth.to_header..bs1$Q$Q UUU%;$Q$Q$Q$Q$Q$Qr4)rrrappendrrrs r2 to_headerzAuth.to_headerZsT_-0@$,/O P ; " II 4 5 5 5 ? & II8 9 9 9499$Q$Qb$Q$Q$QQQQQr4)NrNr)r) r{r|r}rrrrrrr7r4r2rr,s66 *..X.     RRRRRr4rc^eZdZdZdZdZedZedZedZ dS)AnnotatedValuea Meta information for a data field in the event payload. This is to tell Relay that we have tampered with the fields value. See: https://github.com/getsentry/relay/blob/be12cd49a0f06ea932ed9b9f93a655de5d6ad6d1/relay-general/src/types/meta.rs#L407-L423 rxmetadatac"||_||_dSr6r)rsrxrs r2rzAnnotatedValue.__init__os   r4c.tddddggiS)zxThe value was removed because it could not be parsed. This is done for request body values that are not json nor a form.rremz!rawxrrclss r2removed_because_raw_dataz'AnnotatedValue.removed_because_raw_datats6    r4c.tddddggiS)zThe actual value was removed because the size of the field exceeded the configured maximum size (specified with the max_request_body_size sdk option)rr!configrrrrs r2removed_because_over_size_limitz.AnnotatedValue.removed_because_over_size_limits6!    r4c8ttdddggiS)zHThe actual value was removed because it contained sensitive information.rrsr)rSENSITIVE_DATA_SUBSTITUTErs r2+substituted_because_contains_sensitive_dataz:AnnotatedValue.substituted_because_contains_sensitive_datas6+!    r4N) r{r|r}rr~r classmethodrrrr7r4r2rres&I!!!    [     [     [    r4r)TypeVarTcFt|ddpt|ddS)Nr}r{getattrrs r2 get_type_namers% 3 - - Oj$1O1OOr4c4t|dd}|dvr|SdS)Nr|)Nbuiltins __builtins__r)rmods r2get_type_modulers) #|T * *C 444 4r4c |jd}|drdSn#ttf$rYnwxYwdD]#} |j|rdS#t $rY wxYwdS)Nr{z sentry_sdk.T)__traceback_hide____tracebackhide__F) f_globals startswithAttributeErrorKeyErrorf_locals Exception)framer flag_names r2should_hide_framers oj) >>- ( ( 4  H %     ?  ~i( tt     D  5s"';; A A! A!c#XK|}|#t|js|V|j}|!dSdSr6)rtb_frametb_next)rytb_s r2 iter_stacksrsA C / .. IIIk /////r4cd}d}|Vt|drF ||}n#ttf$rd}YnwxYw||}|2 t j|}n#ttf$rgdgfcYSwxYw|sgdgfStd||z }t|dz|zt|} fd|||D} t|| d} fd||dz| D} | | | fS#t$rgdgfcYSwxYw) N get_sourcerr'cXg|]&}t|d'S  max_length strip_stringrOrliners r2 z'get_lines_from_file..sB    F++ C C C   r4r r cXg|]&}t|d'Sr rrs r2rz'get_lines_from_file..sB    F++ C C C   r4)hasattrr  ImportErrorrR splitlines linecachegetlinesrQmaxminlenrrO IndexError) filenamelinenorloadermodule context_linessource source_str lower_bound upper_bound pre_context context_line post_contexts ` r2get_lines_from_filer*sM F gfl;; **622JJW%   JJJ   !**,,F ~ '11FF!   tR<     4|a-/00Kfqj=0#f++>>K     {612   $F6N$8$8$@$@ZXXX      k9:   L,66 4|s4/AA!A66BBAD..E?Ec |jj}n#t$rd}YnwxYw |jd}n#t$rgdgfcYSwxYw |jd}n#t$rd}YnwxYw|dz }||rt |||||SgdgfS)Nr{ __loader__r')r r!)f_code co_filenamerrr*)r tb_linenomax_value_lengthabs_pathr!r rs r2get_source_contextr2s <+ , 4|.  ]F h" f.vf     tR<s-   0AA A A#"A#c` t|S#t$rt|cYSwxYwr6)rr safe_reprrs r2safe_strr5sD      s --c t|dd} |ddS#t$r|cYSwxYw#t$rYdSwxYw)Nr-replacelatin1zunicode-escape )reprrPr0r)rxrs r2r4r4's #e##GY77B yy**112BCCC      # # #"?? #s.#A 'A AA AA A.-A.cD t|S#t$rYdSwxYw)Nr9)r:rrs r2r4r4Bs5 #;;  # # #"?? #s  c|r|s|S |dr |dd}|ddd}||krtj|St j|j}|s|S||tj dddd tj S#t$r|cYSwxYw)Nz.pyc.r'r) endswithsplitrErIbasenamermodules__file__rseplstripr)r!r1 base_modulebase_module_paths r2filename_for_modulerIJs 6   V $ $ %}Hll3**1- & 7##H-- -;{3< O~~.55bfa@@CQGGKRR F    sAC (C AC C/.C/ct|dd}|sd}d}n|jj}|jj} |jd}n#t $rd}YnwxYw||j}t||pd|rtj |nd|pd||d} |rt|||\| d<| d<| d<|rt|j | d<| S) Nr-r{z )rr1functionr!rr'r(r)vars)rr-r.co_namerrf_linenorIrErIabspathr2rr) rr/include_local_variablesinclude_source_contextr0r-r1rKr!rs r2serialize_framerRbs'UHd + +F (<+<', N (99AT19CBGOOH---t+    B DV 9.E E A=2n-r./A*%.))6 Is A AAcd}g}tj}|>t|s&|t |||||j}|>|d|iS)NT)rPrQr0frames)r _getframerrrRf_backreverse)rPrQr0rrTfs r2current_stacktracerYs  F A - ##  MM,C+A%5     H - NN f r4c$t|ddS)Nerrnor) exc_values r2 get_errnor]s 9gt , ,,r4c i}|r|nddd|d<| ||dd<|t|} nd} | D|ddidid | | ||dd <|d k} | s|||dd <d |dd<| rd|dvr d|dd<tduot |t} | r d|dd<t ||d<t ||d<t|dt||d<| d dtn|d |d|d fdt|D} | rd| i|d<|S)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)rhandled mechanismN exception_idmetar[numberr#r parent_idchainedris_exception_groupr!messagerxrPrQr0c Lg|] }t|j|j!S))r/rPrQr0)rRrr/)rryrPrQr0s r2rz5single_exception_from_error_tuple..sM      Kl$;#9-       r4rT stacktrace) rr] setdefaultr rrrrr5rr)exc_typer\ryclient_optionsrarbrer#exception_valuer[is_root_exceptionrgrTrPrQr0s @@@r2!single_exception_from_error_tuplerps3"O%O I$+O+OK 7C $^4)$$  $//;;FF R  *Xu % % % 17 $X.$) 9!64= $[1/8 $V,9V?;+GGG/8 $V,+47J%==B=A $%9: / 9 9OH+H55OF&y)Xi=P=PQQOG"&!%3"01J"K!/0H!I)*<=      b//   F;)16(: % r4__suppress_context__c#K|\}}}g}t}||t||vr|||fV|||t||jr|j}n|j}|dSt|}|}t|dd}||t||vdSdSdSdSdSdS)N __traceback__) setidraddrq __cause__ __context__rr)rrlr\ryseen_exceptionsseen_exception_idscauses r2walk_exception_chainr|s"*)R UU  %9 %777Ir) ) ) )  " "9 - - -  " "2i== 1 1 1- .!+!-}E{{HI66B)  %9 %77777 ! %%77 ! %%r4c#K|VdSr6r7rs r2r|r|!sr4c 0t||||||||}|g} |}|dz }t|do|j} | ro|ot|do|jdu} | rQ|j} t t | | t | dd|||d\}} | | nn|ot|do|jdu}|rQ|j}t t ||t |dd|||d\}} | | |ot|d }|rht|j D]S\}}t t ||t |dd||||d |z\}} | | T|| 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/ )rlr\ryrmrarbrer#r'rqrwNrs)rlr\ryrmrarbr#rx exceptionszexceptions[%s]) rprrqrwexceptions_from_errorrrextendrx enumerater)rlr\ryrmrarbrer#parentrshould_supress_contextexception_has_causer{child_exceptionsexception_has_contentcontextrgidxes r2rr&sA&/ %!   FJIAL$Y0FGGjILj(0  0 ;// 0#4/   0'E/De5/488-#)"000 ,\+   . / / /  2 =11 2%T1  ! 0+G/Dg!7OT::-#)$000 ,\+   . / / /#Gwy,'G'G 0 455 0 0FC/Da1ot44-#)#'#- 0 0 0 ,\+   . / / / / * %%r4c *|\}}}tduot|t}|rt|||||dd\}}n>g}t|D],\}}}|t |||||-||S)Nr)rlr\ryrmrarbre)r rrr|rrprW) rrmrarlr\ryrg_rs r2exceptions_from_error_tuplers 'Hi+47J%==/)   JJ ';H'E'E   #Hi   1i^Y      r4cp t|S#t$rt|ddcYSwxYw)Nr'r=)rUnicodeDecodeErrorr:rs r2 to_stringrsK! !!!E{{1R4    !s !55c#Kd|vr |dVd|vr.|ddpdD]}d|vr |dVd|vr.|ddpdD]}d|vr |dVdSdS)Nrjthreadsvaluesr7 exception)rG)eventthreadrs r2iter_event_stacktracesrsuL!!!!EI&**844: + +Fv%%\****e{+//99?R . .Iy(( ---- . .r4c#jKt|D] }|dpdD]}|V!dS)NrTr7)rrG)rrjrs r2iter_event_framesrsW,U33 ^^H--3  EKKKK r4cvt|D](}t|d|||)|S)NrT)in_app_excludein_app_include project_root)rset_in_app_in_framesrG)rrrrrjs r2 handle_in_apprsT,U33   NN8 $ $))%       Lr4cP|sdS|D]}|d}||d}t||rd|d<Et||rd|d<[|d}|st|rd|d<t||rd|d<|S)Nin_appr!TFr1)rG_module_in_list_is_external_source_is_in_project_root)rTrrrrcurrent_in_appr!r1s r2rrs t8,,  % 8$$ 6> 2 2 "E(O  6> 2 2 #E(O 99Z((    x ( ( #E(O  x 6 6 "E(O   Mr4czt|trt|dkr|\}}}nt|trTt |dd}|t |}|}nNt j\}}}||urd}|}t |}ntdt |z|||fS)Nrsz,Expected Exception object to report, got %s!) rtupler BaseExceptionrrrrr)errorrlr\rys r2rrs%WCJJ!OO"')RR E= ) ) W UOT 2 2 >E{{HII&)lnn #Hi%%! ;;G$u++UVVV Y ""r4cnt|}t|}ddt|||id|fS)Nrr)levelr)rrr)rrmrahints r2event_from_exceptionrsX #8,,H #H - -D5ni     r4cb|dS|sdS|D]#}||ks||dzrdS$dS)NFr>Tr)nameitemsitems r2rr'sX |u u 4<<4??4#:66<44  5r4c4tjd|du}|S)Nz [\\/](?:dist|site)-packages[\\/]research)r1external_sources r2rr6s& 5x@@L r4c<|dS||rdSdS)NFTr)r1rs r2rr?s/u<((t 5r4c|s|S|t}t|d}||kr*t|d|dz dz|dd|dz |ggdS|S)Nr-rz...z!limitr)rrr)rrr0r)rxrlengths r2rrKs  - g&& ' 'F (*q.()E1!3 Q CD     Lr4c^ ddl}ddlm}tdt jd|jddD}|ddr&tjd kr|d ks |d d rd SdSn#t$rYnwxYw ddl m }|drdSn#t$rYnwxYwd S)z Returns whether gevent/eventlet have patched the stdlib in a way where thread locals are now more "correct" than contextvars. rN)is_object_patchedc,g|]}t|Sr7)r)rparts r2rz*_is_contextvars_broken..ks R R R4SYY R R Rr4z a|b|rc|\.r? threadinglocalrr) contextvars ContextVarFT)is_monkey_patchedr) gevent gevent.monkeyrrrrA __version__r version_inforeventlet.patcherr)rr version_tuplers r2_is_contextvars_brokenr`s1   333333 R R28L&:L#M#Mbqb#Q R R R    [' 2 2 !V++ 0H0H%%m\BB1Iu4        666666  X & & 4        5s$A1A88 BB B B*)B*c2Gfddt}|S)Nc&eZdZfdZdZdZdS)1_make_threadlocal_contextvars..ContextVarc4||_|_dSr6)_name_local)rsrrs r2rz:_make_threadlocal_contextvars..ContextVar.__init__sDJ%''DKKKr4c.t|jd|S)Nrx)rr)rsdefaults r2rGz5_make_threadlocal_contextvars..ContextVar.gets4;99 9r4c||j_dSr6)rrx)rsrxs r2rtz5_make_threadlocal_contextvars..ContextVar.sets %DK   r4N)r{r|r}rrGrtrsr2rrsL " " " " "  : : : & & & & &r4r)object)rrs` r2_make_threadlocal_contextvarsrs?&&&&&&&V&&& r4ctsFtjdkr ddlm}d|fS#t $rYnwxYw ddlm}d|fS#t $rYnwxYwddlm}dt|fS)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)rTrF) rrraiocontextvarsrrrrrr)rrs r2_get_contextvarsrs " # #  f $ $ 555555Z''     222222Z''       /66 66s * 77 A AAz 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. cd} |jjd|jjd|jS#t$rYnwxYwd\}}tr)rr_partialmethod)zpartialmethod()r{)zpartial(Raised when a serverless method is about to reach its timeout.Nrr7r4r2rrsHHDr4rc$eZdZdZdZdZdZdS) TimeoutThreadzCreates a Thread which runs (sleeps) for a time duration equal to waiting_time and raises a custom ServerlessTimeout exception. ctj|||_||_tj|_dSr6)rThreadr waiting_timeconfigured_timeoutEvent _stop_event)rsrrs r2rzTimeoutThread.__init__s?!!$'''("4$?,,r4c8|jdSr6)rrtrrs r2stopzTimeoutThread.stops r4c|j|j|jrdSt |j}||jkr|dz}t d|)Nr'zZWARNING : Function is expected to get timed out. Configured timeout duration = {} seconds.)rwaitris_setrrrrj)rsinteger_configured_timeouts r2runzTimeoutThread.runs d/000   " " $ $  F%()@%A%A" &(? ? ?)Ca)G &' h o o*     r4N)r{r|r}rrrrr7r4r2rr sK---     r4rcd} |d}tj|}|d}nF#t$r9}t d||Yd}~nd}~wwxYw|S)zO Convert a string to base64, via UTF-8. Returns None on invalid input. NUTF-8z"Unable to encode {orig} to base64:)orig)r0base64 b64encoderPrloggerwarningrj)original base64_string utf8_bytes base64_byteserrs r2 to_base64r0s MX__W-- ' 33 $++G44 XXX;BBBQQSVWWWWWWWWX s>A B /BBcRd} t|}|sJ|d}tj|}|d}nF#t $r9}td ||Yd}~nd}~wwxYw|S)zQ Convert a string from base64, via UTF-8. Returns None on invalid input. Nrz#Unable to decode {b64} from base64:)b64) BASE64_ALPHABETmatchr0r b64decoderPrrrrj)r utf8_stringonly_valid_charsrrrs r2 from_base64rAs K  *00??$++G44 %l33  ''00     1 8 8] 8 K KS         sAA!! B$+/BB$ Components)rrrIqueryfragmentct|}t|jd}|rP|jd}t |dkrt dt d|d}n|j}n|j}|r'ttd|D}n|j}t|j |||j |j } |r| St| S) zL Removes the authority and query parameter values from a given URL. T)keep_blank_valuesrr'r*r=ci|] }|t Sr7)r)rrs r2 z sanitize_url..ssNNN#s5NNNr4rrrrIr)r rrrrArrrr rrrIrr ) urlremove_authorityremove_query_valuesrA parsed_url query_params netloc_partsr query_string componentss r2 sanitize_urlr!Zs #JJ,EEEL #!(..s33 |  q ))))))R  FF  &FF"( NNNNN O O  "'   _$ J &*%%%r4 ParsedUrlrrrc t|d|d}tt|j|jd|jd}t ||j|jS)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)rrrArrr#) r!r rrrrIr"rr)rsanitizerbase_urls r2 parse_urlr's dJ$$    H  $   r4c |t|ttfrtj|r?t d||t|dSt|}|dks|dkr1t d||dSdS) 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}.)r#raterFrr'zW{source} Given sample rate is invalid. Sample rate must be between 0 and 1. Got {rate}.)r#r)T) rrrmathisnanrrrjrfloat)r)r#s r2is_valid_sample_rater-s dT7O , , 40@0@ K R RDtDzz R     u ;;D axx4!88 e l lD m     u 4r4cr|dS|D]/}|s|ddkr|dz }tj||}|rdS0dS)NFr=$Tr)r regex_listsubstring_matching item_matchermatcheds r2match_regex_listr4siu" ! l2&6#&=&= C L)L$//  44  5r4cd}tjd|zdztjtjz} ||d}t tt| ddd}n#tttf$rYdSwxYw|S)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[0-9]+)!)? # epoch (?P[0-9]+(?:\.[0-9]+)*) # release segment (?P
                                          # pre-release
                [-_\.]?
                (?P(a|b|c|rc|alpha|beta|pre|preview))
                [-_\.]?
                (?P[0-9]+)?
            )?
            (?P                                         # post release
                (?:-(?P[0-9]+))
                |
                (?:
                    [-_\.]?
                    (?Ppost|rev|r)
                    [-_\.]?
                    (?P[0-9]+)?
                )
            )?
            (?P                                          # dev release
                [-_\.]?
                (?Pdev)
                [-_\.]?
                (?P[0-9]+)?
            )?
        )
        (?:\+(?P[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
    z^\s*z\s*$rSr>Nr)
rcompileVERBOSE
IGNORECASEr	groupdictrmaprrArrr)rVERSION_PATTERNpatternrS
release_tuples     r2
parse_versionr>sO>j/!G+

R]"G
--((2244Y?c#w}}S'9'9"1"'=>>??

z>2ttsA*B!!B<;B<c(tjSr6)timeperf_counter_nsr7r4r2nanosecond_timerB
s#%%%r4cHttjdzS)NgeA)rr@perf_counterr7r4r2rBrBs4$&&,---r4ctr6)rr7r4r2rBrBsr4c(tjSr6)r@r7r4r2nowrGsy{{r4c(tjSr6)r@rDr7r4r2rGrG#s """r4r6)NNN)NTTN)TTN)NNNNN)NNrrN)NN)TTF)T)NF)rr.rloggingr*rErrKrrr@collectionsrrdecimalrnumbersrurllib.parserrr	r
rrcgiurllibrrrr
	functoolsrrr
sentry_sdksentry_sdk._compatrrrrrsentry_sdk._typesrsentry_sdk.constsrtypesrrtypingrrrrrrr r!r"r#r$r%r&r	getLoggerrr6rrr3r8rVrnrrprrrvrrrrrrrrrr	Annotatedrrrrr*r2r5r4rIrRrYr]rprrHAS_CHAINED_EXCEPTIONSr|rrrrrrrrrrrrrrrrHAS_REAL_CONTEXTVARSrCONTEXTVARS_ERROR_MESSAGErrrrrrrrrr!r"r'r-r4r>rBrGr7r4r2r\s




								



""""""$%%%%%%$$$$$$&&&&&&%%%%%%'''''''$$$      !!!!!!########
$+++++++%''''''#%%%$%SSSSSSSSSSSSSSSS++++++6666668........87777777	q!
	.	/	/"*122(TTT			$$$NDv7688'''
222+++
333
	"	"	"	""""""Z"""F
F
F
F
F
&F
F
F
R6R6R6R6R6R66R6R6Rr=
=
=
=
=
V=
=
=
@)Ana'(IPPP
&++++b4   "#####6###4 ''''V!6---NNNNb!,BCC$7777@]&]&]&]&D""""J!!!...



$$$$N###0*			*(((V*#7#7#7L$4#3#5#5 j'''T(((
#
#:;;					y			#
#
#
#
#
I$#
#
#
L",Z&W&W&W
X
X
)&)&)&)&X
J{$@$@$@AA	8>



 111h&&&&

....

######s6A%%#B
BBB B 0B99CC