wi'>ddlZddlZddlZddlZddlmZmZddlmZddl m Z ddl m Z m Z ddlmZmZmZmZmZmZmZmZmZmZmZddlmZddlmZmZmZm Z m!Z!m"Z"dd lm#Z$dd lm%Z%dd l&m'Z'd d l(m)Z)d dl*m+Z+m,Z,d dl-m.Z.d dl/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6d dl7m8Z8d dl9m:Z:m;Z;d dlm?Z?d dl@mAZAd dlBmCZCmDZDd d lEm#Z#d dlFmGZGejHdkZIdZJdZKdeDdeDdeeeLeLeLffdZMddd d!dd"d"eJeKdd#ddd#d$dd%d&ee0d'eeLd(eeLd)eLd*eeNd+eOd,eOd-eLd.eLd/eeLd0eOd1eeOd2ee3d3eOd4eeeNe fd5eLdeeePePee geff"d6ZQeGd7d8ZReGd9d:ZSeGd;d<ZTeGd=d>ZUGd?d@e:ZVGdAdBZWeXdCkr0eQd#DddlZdEeddfdFZYdEeddfdGZZdIdHZ[e[dSdS)JN) dataclassfield)islice)walk_tb) ModuleType TracebackType) AnyCallableDictIterableListOptionalSequenceSetTupleTypeUnion)guess_lexer_for_filename)CommentKeywordNameNumberOperatorString)Text)Token) ClassNotFound)pretty)loop_first_last loop_last)Columns)ConsoleConsoleOptionsConsoleRenderableOverflowMethodGroup RenderResultgroup) Constrain)RegexHighlighterReprHighlighter)Panel) render_scope)Style)SyntaxSyntaxPosition)Themewin32 Pstartendreturnc#K|\}}|\}}||kr |||fVdStt||dzD]!\}}}|r||dfV|r|d|fV|ddfV"dS)zYield start and end positions per line. Args: start: Start position. end: End position. Returns: Iterable of (LINE, COLUMN1, COLUMN2). rrN)r range) r6r7line1column1line2column2firstlastline_nos ^/home/jenkins/workspace/simtester-sanitize/venv/lib/python3.11/site-packages/rich/traceback.py_iter_syntax_linesrD8sNE7NE7 ~~Wg%%%%%%$3E%4K4K$L$L % % E4 %w***** %q')))))q"n$$$$  % %dXFT)consolewidth code_width extra_linestheme word_wrap show_localslocals_max_lengthlocals_max_stringlocals_max_depthlocals_hide_dunderlocals_hide_sunderlocals_overflow indent_guidessuppress max_framesrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYc |tdn|jr dn dttdtdtt ddf  fd d t ddffd } t}||tj S#t$rtj }t_ |cYSwxYw) aInstall a rich traceback handler. Once installed, any tracebacks will be printed with syntax highlighting and rich formatting. Args: console (Optional[Console], optional): Console to write exception to. Default uses internal Console instance. width (Optional[int], optional): Width (in characters) of traceback. Defaults to 100. code_width (Optional[int], optional): Code width (in characters) of traceback. Defaults to 88. extra_lines (int, optional): Extra lines of code. Defaults to 3. theme (Optional[str], optional): Pygments theme to use in traceback. Defaults to ``None`` which will pick a theme appropriate for the platform. word_wrap (bool, optional): Enable word wrapping of long lines. Defaults to False. show_locals (bool, optional): Enable display of local variables. Defaults to False. locals_max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation. Defaults to 10. locals_max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to 80. locals_max_depth (int, optional): Maximum depths of locals before truncating, or None to disable. Defaults to None. locals_hide_dunder (bool, optional): Hide locals prefixed with double underscore. Defaults to True. locals_hide_sunder (bool, optional): Hide locals prefixed with single underscore. Defaults to False. locals_overflow (OverflowMethod, optional): How to handle overflowing locals, or None to disable. Defaults to None. indent_guides (bool, optional): Enable indent guides in code and locals. Defaults to True. suppress (Sequence[Union[str, ModuleType]]): Optional sequence of modules or paths to exclude from traceback. Returns: Callable: The previous exception handler that was replaced. NT)stderrtype_value tracebackr8ct||| t  }|dS)NrKrLrMrNrOrPrQrRrSrTrUrVrWrXrY) Tracebackfrom_exceptionboolprint)r\r]r^exception_tracebackrLrMrWrTrUrSrQrRrVrYrPrXrNtraceback_consolerKrOs rC excepthookzinstall..excepthooks| (66   !##//-1#$677+'!%7  (  344444rEipc ijdtdtddffd }dddtdtdtddffd_|_fd _dS) Nargskwargsr8c||i|dS)zEwrap the default ip.showtraceback to store info for ip._showtracebackNrI)rjrkdefault_showtracebacktb_datas rCipy_show_tracebackzCinstall..ipy_excepthook_closure..ipy_show_tracebacks&G ! !4 26 2 2 2 2 2rEF) is_syntaxrpc }|rdn|d} dd} d}||rdnd}t|D] }|n|j}|d|d|i dS)z2Internally called traceback from ip._showtracebackNrunning_compiled_codeF tb_offsetrr) _get_exc_infogetr;tb_next) rprjrk exc_tupletbcompiledrt_rgrhrns rCipy_display_tracebackzFinstall..ipy_excepthook_closure..ipy_display_tracebacks ((**I3<*M$$1B{{#:EBBH K00I !)0AAq 9%%  :EZ Jy|Yq\2 6 6 6GGGrEc|ddi|S)NrpTrI)rjrkr|s rCz9install..ipy_excepthook_closure..s(5J5J 6 !6 %+6 6 rE) showtracebackr rc_showtracebackshowsyntaxerror)rhrormr|rnrgs` @@@rCipy_excepthook_closurez'install..ipy_excepthook_closures " 0 3c 3S 3T 3 3 3 3 3 3 3+0    #' ;>          42-    rE) r# is_jupyterr BaseExceptionrrr get_ipythonsysrg Exception)rJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrrhold_excepthookrgrfs ``````````````` @@rCinstallrTsr^18t,,,,W  ( -?-G   5M"55M*5  5555555555555555555556) 3) 4) ) ) ) ) ) V  ]]r"""~ # s$B**$CCceZdZUeed<eed<eed<dZeed<dZee ee j fed<dZ ee e eefe eeffed<dS) FramefilenamelinenonamelineNlocalslast_instruction)__name__ __module__ __qualname__str__annotations__intrrrr rNoderrrIrErCrrsMMM KKK IIID#NNN/3FHT#v{*+ ,333JNhuU38_eCHo%EFGNNNNNrErcpeZdZUeed<eed<eed<eed<eed<eeZe eed<dS) _SyntaxErroroffsetrrrmsgdefault_factorynotesN) rrrrrrrlistrr rIrErCrrs` KKKMMM III KKK HHHuT222E4922222rErceZdZUeed<eed<dZeeed<dZe ed<e e Z e eed<e e Ze eed <dZe ed <e e Ze d ed <dS) Stackexc_type exc_valueN syntax_errorFis_causerframesris_groupTrace exceptions)rrrrrrrrrrcrrrr rrrrrIrErCrrsMMMNNN+/L(<(///Hd%555FDK555uT222E49222Hd %d ; ; ;JW ;;;;;rErc&eZdZUeeed<dS)rstacksN)rrrr rrrIrErCrrs" KrErceZdZdgZdS)PathHighlighterz(?P.*/)(?P.+)N)rrr highlightsrIrErCrrs-.JJJrErc(eZdZdZddddddZ d4dd d dd d eedd d dd d dddeedee dee de dee de de de de dee de de dee de de ee efde f dZedd d dd d eedd d dd d dd d!eed"ed#eedee dee de dee de de de de dee de de d$ee de de ee efde d%df&d&Zed eedd d dd'd!eed"ed#eede de de dee de de d(eeed%efd)Zd*ed+ed%efd,Zed-ed%efd.Zed/e d0e d%e fd1Z ed2e!d%efd3Z"dS)5raaA Console renderable that renders a traceback. Args: trace (Trace, optional): A `Trace` object produced from `extract`. Defaults to None, which uses the last exception. width (Optional[int], optional): Number of characters used to traceback. Defaults to 100. code_width (Optional[int], optional): Number of code characters used to traceback. Defaults to 88. extra_lines (int, optional): Additional lines of code to render. Defaults to 3. theme (str, optional): Override pygments theme used in traceback. word_wrap (bool, optional): Enable word wrapping of long lines. Defaults to False. show_locals (bool, optional): Enable display of local variables. Defaults to False. indent_guides (bool, optional): Enable indent guides in code and locals. Defaults to True. locals_max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation. Defaults to 10. locals_max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to 80. locals_max_depth (int, optional): Maximum depths of locals before truncating, or None to disable. Defaults to None. locals_hide_dunder (bool, optional): Hide locals prefixed with double underscore. Defaults to True. locals_hide_sunder (bool, optional): Hide locals prefixed with single underscore. Defaults to False. locals_overflow (OverflowMethod, optional): How to handle overflowing locals, or None to disable. Defaults to None. suppress (Sequence[Union[str, ModuleType]]): Optional sequence of modules or paths to exclude from traceback. max_frames (int): Maximum number of frames to show in a traceback, 0 for no maximum. Defaults to 100. textpythoncythonpyrex)rz.pyz.pxdz.pyxz.pxiNrFrGrHFTrI)rKrLrMrNrOrPrQrRrSrTrUlocals_overlowrWrXrYtracerKrLrMrNrOrPrQrRrSrTrUrrWrXrYc|Etj\}}}|||td|||||}||_||_||_||_tj |pd|_ ||_ ||_ ||_ ||_| |_| |_| |_| |_| |_g|_|D]}t+|t,s9|j J|dt0j|j}n|}t0jt0j|}|j||dkrt=d|nd|_dS)Nz9Value for 'trace' required if not called in except: blockrP ansi_darkz+ must be a module with '__file__' attributer) rexc_info ValueErrorextractrrKrLrMr0 get_themerNrOrPrWrQrRrSrTrUrVrX isinstancer__file__ospathdirnamenormpathabspathappendmaxrY)selfrrKrLrMrNrOrPrQrRrSrTrUrrWrXrYrrr^suppress_entityrs rC__init__zTraceback.__init__'s( =-0\^^ *Hi9#4 8I OLL)YK!E  $&%e&:{;; "&*!2!2 0"4"4-') ' ' 'Oos33 '#,88%TTT988w'?@@&7##BGOOD$9$9::D M  & & & &0:Q#a,,,ArEr`rrr^rVr8cl||||| | | | | | }||f|||||| || | | | ||||dS)aCreate a traceback from exception info Args: exc_type (Type[BaseException]): Exception type. exc_value (BaseException): Exception value. traceback (TracebackType): Python Traceback object. width (Optional[int], optional): Number of characters used to traceback. Defaults to 100. code_width (Optional[int], optional): Number of code characters used to traceback. Defaults to 88. extra_lines (int, optional): Additional lines of code to render. Defaults to 3. theme (str, optional): Override pygments theme used in traceback. word_wrap (bool, optional): Enable word wrapping of long lines. Defaults to False. show_locals (bool, optional): Enable display of local variables. Defaults to False. indent_guides (bool, optional): Enable indent guides in code and locals. Defaults to True. locals_max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation. Defaults to 10. locals_max_depth (int, optional): Maximum depths of locals before truncating, or None to disable. Defaults to None. locals_max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to 80. locals_hide_dunder (bool, optional): Hide locals prefixed with double underscore. Defaults to True. locals_hide_sunder (bool, optional): Hide locals prefixed with single underscore. Defaults to False. locals_overflow (OverflowMethod, optional): How to handle overflowing locals, or None to disable. Defaults to None. suppress (Iterable[Union[str, ModuleType]]): Optional sequence of modules or paths to exclude from traceback. max_frames (int): Maximum number of frames to show in a traceback, 0 for no maximum. Defaults to 100. Returns: Traceback: A Traceback instance that may be printed. )rPrQrRrSrTrU)rKrLrMrNrOrPrWrQrRrSrTrUrrXrY)r)clsrrr^rKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrich_tracebacks rCrbzTraceback.from_exception`sb   #//-11%   s  !##'//-11*!!    rE)rPrQrRrSrTrU_visited_exceptionsrc  g} d} ddlm} t|ddpg}| tn| }dtdt fd} t ||j||| | }tj d krt|ttfrwd |_ |jD]h}||vr|||jt"t'|||j| | it|t*r;t-|jpd|jpd |jpd|jpd|j||_| ||jj}dt<t>t t@fdt<t>t t@ff fd }tC|D]q\}}|j"j#}d}tj d krY|j$dz}tKtM|j"'||dz}|\}}}}|| | |||f||ff}|rT|(ds?tRj*+|s tRj*,| |}|j-.ddrt_|pd ||j"j0|r0fd||j-1Dnd|}|||j-.ddr |jdd=s|sYt|dd} | | |ur| j2}| }| j}d } =|j3} | %t|dds| j2}| }| j}d} k ti| }!|!S)a,Extract traceback information. Args: exc_type (Type[BaseException]): Exception type. exc_value (BaseException): Exception value. traceback (TracebackType): Python Traceback object. show_locals (bool, optional): Enable display of local variables. Defaults to False. locals_max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation. Defaults to 10. locals_max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to 80. locals_max_depth (int, optional): Maximum depths of locals before truncating, or None to disable. Defaults to None. locals_hide_dunder (bool, optional): Hide locals prefixed with double underscore. Defaults to True. locals_hide_sunder (bool, optional): Hide locals prefixed with single underscore. Defaults to False. Returns: Trace: A Trace instance which you can use to construct a `Traceback`. Fr) _IMPORT_CWD __notes__N_objectr8cD t|S#t$rYdSwxYw)z1Don't allow exceptions from __str__ to propagate.z)rr)rs rCsafe_strz#Traceback.extract..safe_strs7 27||# 2 2 2111 2s  T)rrrr)rH )rPrQrTrUr?r)rrrrrr iter_localsc3Ks s |Ed{VdS|D];\}}r|drr|dr5||fV.get_locals s+.@********F"-%%JC)!cnnT.B.B! )!cnnS.A.A! u*$$$$ %%rErrr<_rich_traceback_omitc i|]F\}}tj|tj|-|tj|GS)) max_length max_string max_depth)inspect isfunctionisclassrtraverse).0rr]rSrQrRs rC z%Traceback.extract..Dsv   !+U$+$6u$=$= BIQVAWAW  %+<+<*: """   rE)rrrrr_rich_traceback_guard __cause____suppress_context__)r)5richrgetattrsetr rrrr version_inforBaseExceptionGroupExceptionGrouprraddrrartype __traceback__ SyntaxErrorrrrrrrrrr robjectrf_code co_filenamef_lastinextr co_positionsrrrisabsjoinf_localsrvrco_nameitems __class__ __context__r)"rrrr^rPrQrRrSrTrUrrrrrgrouped_exceptionsrstack exceptionrr frame_summaryrBrrinstruction_indexinstruction_position start_lineend_line start_column end_columnframecausers" ````` rCrzTraceback.extractsB!$$$$$$"9k4@@FB)0CEEE6I  2c 2c 2 2 2 2I !("344"(9--! E7**i*.render_stacks| +6;&&u--S*!3" 777 $--=tz#J#J &&77++****+++++++++++++++!-&&77  # 55e6HII"2)H#'$*"&*                      m***,@AK 2 677 Qm***,@AK00 m%8:N$OPPPPP  V Vm$A;;tCTCTUUUUUU~ 1:5;KQ1O1O  -Ho68&3<_=S3T3TYY/ K*11,,{J2W2WXXXXHHH#!#56">H">">)A   >*e*d   s%A..A25A2AC))C-0C-)rNget_background_styleget_style_for_tokenr2 TextTokenrrrFunctionrrr/rConstant Delimiterrr,r)rrcr(r!reversedrr) rrJrrN token_stylerArr,r-r.r/s `` @@@@rC__rich_console__zTraceback.__rich_console__rs  5577/  ++i00 U!3!3 ";;v#6#6 $[[%?%?   ";;v#6#6   {{733eoooE  KK// kk)44u$7G7G7GG {{622 !++g.>"?"? ";;w/?#@#@ [[)9::  F,< = =  H 5 5 [[..  $[[%?%?%D///%Q! $'   ,&'' A A TA lA A A A A A A A A A  A F%Xdj.?%@%@AA , ,KD%,ud++ + + + + , ,rErc#<Kt}t}|jdkrgtj|jrCt jd|jdfdt|j dfd}||V||j }d|_ t|jd z t|}|d |||t jd d|zzd zdz }|VdS) Nz r:rrrrTrzbold underline u[traceback.offset]▲[/])r,rrrrexistsrr#rrrrstripno_wrapminrlenstylizer%)rrr-path_highlighterrsyntax_error_textrs rCr"zTraceback._render_syntax_errorsJ%'' *,,  I - -w~~l344 -}0.002CD*,--/@A)  '&t,,,,,'K (9(@(@(B(BCC$(!\(1,c2C.D.DEE!!"2FFCCCT- 3< "< <!     rErcodecztj|d}|sT|d}|dkr |d|n|}|drd|vrdS |j|pt||j S#t$rYdSwxYw)Nr:r>z#!rr) rrsplitextindexrlowerLEXERSrvrrr)rrrGextnew_line_index first_lines rC _guess_lexerzTraceback._guess_lexersgx((, "ZZ--N2@B2F2Fo~o..DJ$$T** x:;K;K;M;M/M/Mx :>>#&&W*B8T*R*R*W W   66 s=.B,, B:9B:rc #XKt}j}dtdttffd }d}jdkr5t jdzt|jjdzz }d}t|jD]\}}|r||vrd}|r+|Jtdt|d d d Vd}|dk} |j tfd j D} tj|j rStj|t|j ddt%|jdfd|jdfd} n4tjd|jdfdt%|jdfd} |j ds| sdV| V|j dr||Ed{Ve| s t-j|j } d| } | s|j | }t5| ||d|jjz |jjzf|jhjjjd }dV|j|j\}}tA||D]\}}} |dkr<| |dz }t|t|!z }|dkrt| |dz }n#tD$rYtwxYw|#d||f||f|j$rtK|g||dn|V#tL$r&}tjd|d fVYd}~d}~wwxYwdS)Nrr8c 3K|jr8t|jdjjjjjVdSdS)Nr)rrWrrroverflow)rr.rWrQrRrSrV)rrs rC render_localsz.Traceback._render_stack..render_localssl| "L""&"4#5#5"3!1  rErrrFTz ... z frames hidden ...centerztraceback.error)justifyrc3BK|]}|VdSNr)rrframe_filenames rC z*Traceback._render_stack..(s1WW^66t<<WWWWWWrErr=r;rz in rrzin rr)rN line_numbers line_rangehighlight_linesrOrLrWdedentrr:ztraceback.error_range)rr6r7)rr>)'rrNrr r%rYr;rCrr$rranyrXrrr?r#rrrr linecachegetlinesrrPr0rMrOrLrWrrDlstrip IndexError stylize_rangerr"r)rrrErNrTexclude_framesexcluded frame_indexrr@ suppressedr code_linesrG lexer_namesyntaxr6r7r<r=r?rerrorrYs` @rCr zTraceback._render_stacks*,,   84E+F      +/ ?a  "1$EL!!DOq$88N "+EL"9"9g g  K +"?"? !%111DS00DDD$+ !1$E"^NWWWWWWWWWJw~~en-- }$$T%.@Q%R%R%RSS*&&(9:Z!45) }Z!45*&&(9:) >,,S11 % JJJ~((-- (=/////////> =!*!3EN!C!CJ77:..D!!!%!2!25>4!H!HJ#"#%)!L4+;;!L4+;;$*/"&.#'?&*&8$FHHH -9%*%; s8J%QT7U7U3E7G )#*a<<+5eai+@D.1$ii#dkkmm:L:L.LG#*b==.1*UQY2G.H.HG#-)))!)) #00&=',g&6%*G$41!<$ &!.u!5!5%& $    7!-%e'893> Sg g s2:0M5,A)M5=A L L+*L+5 N%?N  N%rX)#rrr__doc__rLLOCALS_MAX_LENGTHLOCALS_MAX_STRINGrrrrrcr&r rrr classmethodrr rrrbrrr#r$r(r8r)rr"rPrr rIrErCrarasz2  F"&7F #$&#!!2!2*.#'#(37"57%7F7F7F7F} 7F SM 7F  7F}7F7F7F7F7F#3-7F!7F!7F!07F !7F"5j12#7F$%7F7F7F7Fr #$&#!!2!2*.#'#(48"57)M M M s)M !M M* M } M SMM M }M M M M M #3-M !M !!M "".1#M $%M &5j12'M ()M * +M M M [M ^"!2!2*.#'#(<@}%!M*   #3-!!&c-&89 [Bd,d,)7d, d,d,d,d,L UWW  ,    W , C s s   [  UWW5\ WrEra__main__rac.d}t||z dS)Nr)rd)rrones rCbarrus cAgrEc6d}hddd}t|dS)NT> Duncan Idaho Thufir Hawat Paul AtreidesVladimir Harkonnen)NFT) characters atomic_types)ru)rrrzeds rCfoor~s9 $ 0   ArEc$tddS)Nr)r~rIrErCrlrls ArE)r8N)\rr`rr dataclassesrr itertoolsrr^rtypesrrtypingr r r r r rrrrrrpygments.lexersrpygments.tokenrrrrrrrr2r pygments.utilrrr_loopr r!columnsr"rJr#r$r%r&r'r(r) constrainr*r-r+r,panelr-scoper.rr/rkr0r1rrNr2platformWINDOWSrnrorrDrrcrrrrrrrrarrur~rlrIrErCrs+ ((((((((++++++++                          544444KKKKKKKKKKKKKKKK,,,,,, ''''''--------! ::::::::******** ,' !% % .% eCcM"#%%%%<"& "..&*#)-0413#FFF g F C=F F  F C= FFFFFsmFF!Fn-FF uS*_-.!F"#F$tM"M8M3JKSPQ%FFFFR OOOOOOO O 3333333 3 <<<<<<< <  /////&///y y y y y y y y x z GJJJ   s t     EGGGGG5rE