xi 8UddlZddlZddlZddlmZmZddlmZmZddl m Z ddl m Z ddl m Z ddlmZddlmZdd lmZdd lmZmZmZdd lmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)dd l*m+Z+d dl,m-Z-m.Z.d dl/m/Z/d dl0m1Z1m2Z2d dl3m4Z4d dl5m6Z6m7Z7d dl8m9Z9m:Z:d dl;mm?Z?d dl@mAZAd dlBmCZCmDZDd dlEmFZGd dlHmIZImJZJd dlKmLZLmMZMd dlNmOZOd dlPmQZQd dlRmSZSd dlTmUZUd dlVmWZWmXZXd d lYmZZZd d!l[m\Z\m]Z]m^Z^d d"l_m`Z`maZad d#lbmcZcmdZderd d$lemfZfd d%lgmhZhd d&limjZjd'Zkd(Zlejmd)kZnee'eod*fgd*fZped+Zqed,ZrGd-d.ZsesZt ejuvZwn #ex$rdZwYnwxYw ejyvZzn #ex$rd ZzYnwxYw ej{vZ|n #ex$rd/Z|YnwxYweweze|fZ}eze|fZ~eZGd?d@ZGdAdBZGdCdDZGdEdFZGdGdHZdxdJedKedLedLefffdMZdKefdNZeG3<5>2;1:###S(]##h' # h' # x .89 #0(:;#x~x/0#$12#htnh./#hsmX-.# ####J # *:     C ,<     s C s &* r_c8|j|Sr)r begin_capturer~s r` __enter__zCapture.__enter__B ##%%% r_exc_typeexc_valexc_tbcB|j|_dSr)r end_capturerrrrrs r`__exit__zCapture.__exit__Fs }0022 r_c<|jtd|jS)zGet the result of the capture.Nz.decorator.._replaces* &$1&11K+/3// /r_)rrr)rrrs` r` decoratorzgroup..decoratorsU v 0C 03 05 0 0 0 0 0 0  0r_)rrrr)rrs` r`grouprsQ h~667  #u*        r_c tn#t$rYdSwxYwt}|jj}dt |jvst jds|dkrdS|dkrdSdS)z-Check if we're running in a Jupyter notebook.Fz google.colabDATABRICKS_RUNTIME_VERSIONZMQInteractiveShellTTerminalInteractiveShell) get_ipython NameError __class__r[rosgetenv)ipythonshells r` _is_jupyterr#s uummG   &E#g/0000 91 2 2 1 ) ) )t , , ,uus  )standard256 truecolorwindowsci|]\}}|| Sr^r^).0namesystems r` r,sOOOvOOOr_cZeZdZUdZeed<eeZe e ed<dZ e ed<dS)ConsoleThreadLocalsz(Thread local values for Console context. theme_stack)default_factoryrr buffer_indexN) r[r\r]rirHrkrr rrr=r1rjr^r_r`r.r.sU22!E$777FDM777L#r_r.cJeZdZdZedeedeefdZdS) RenderHookz(Provides hooks in to the render process.rrzcdS)aLCalled with a list of objects to render. This method can return a new list of renderables, or modify and return the same list. Args: renderables (List[ConsoleRenderable]): A number of renderable objects. Returns: List[ConsoleRenderable]: A replacement list of renderables. Nr^)rrs r`process_renderableszRenderHook.process_renderables#sr_N)r[r\r]rirrrr5r^r_r`r3r3 sT22   12       ^    r_r3rI_windows_console_featurescLttSddlm}|atS)Nr#get_windows_console_features)r6_windowsr9r8s r`r9r96s5 ,((666666 < < > > $$r_c8totj S)zDetect legacy Windows.)WINDOWSr9vtr^r_r`detect_legacy_windowsr>@s  <799<<e-d?e-d(dfd@Z.ddAZ/d(efdBZ0ddCdedDe d(dfdEZ1ddFZ2ddCdedDe d(e3fdGZ4ed(e efdHZ5ed(efdIZ6ed(e fdJZ7ed(e fdKZ8ed(e9fdLZ:ed(e;fdMZe>jded(dfdQZ>ed(efdRZ?e?jded(dfdSZ?ddTZ@d(eAfdUZB ddVe eCdWe dXe d(eDfdYZEdd[ed(dfd\ZFdd]e d(dfd^ZGd_d`dadbdcddeHdeedfedgedhed(dif djZIddke d(e fdlZJddme d(e fdnZKed(e fdoZLdped(e fdqZM ddre de ed(dsfdtZNddudveHdwe e9d(eOfdxZP ddveHdwe e9d(eQefdyZR dddddzdveHdwe e9de eSd{e d|e d(eeef d}ZTd~ddddddddedeeeSfde eUde eVde e de e de e d!e eWd(dfdZXdddeeeSfde eeSefd(eSfdZYddddddeQe-dedede eUde e de e de e d(eeZfdZ[ ddddddpe\dedeeeSfde]d(df dZ^de_d(dfdZ`dddddde-dedede eeeSfde e d(df dZadddddddddddddddde-dedede eeeSfde eUde eVde e de e de e de e de ede ede de e de d(df dZb ddddddddddd de ede-dedeefde de de de de de ee-ge-fde d(dfdZcddddveHde eddwe e9d(dfdZe ddeeededed(dfdZfddddddddde edede ede de deQeeegfded(dfdZhei ddede ege ejfd(e=eeekee-fffdZldddddddddZd de-dedede eeeSfde eUde e de e de e de ded(dfdÄZmddĄZnddńZoddƄZpdeQed(efdȄZq ddddddɜde\de de de de erd(ef d̈́ZsdddΜde dWe d(efdЄZtdddΜdeeeuefde dWe d(dfd҄ZvdddddӜde ewde de ede d(ef dքZxddeyddӜdeeeuefde ewde dede d(df dׄZzddde{dddڜdpede ewde dedede ed(efd݄Z|ddde{dddڜdeeeuefdpede ewde dedede ed(dfdބZ}dS)rar A high level console interface. Args: color_system (str, optional): The color system supported by your terminal, either ``"standard"``, ``"256"`` or ``"truecolor"``. Leave as ``"auto"`` to autodetect. force_terminal (Optional[bool], optional): Enable/disable terminal control codes, or None to auto-detect terminal. Defaults to None. force_jupyter (Optional[bool], optional): Enable/disable Jupyter rendering, or None to auto-detect Jupyter. Defaults to None. force_interactive (Optional[bool], optional): Enable/disable interactive mode, or None to auto detect. Defaults to None. soft_wrap (Optional[bool], optional): Set soft wrap default on print method. Defaults to False. theme (Theme, optional): An optional style theme object, or ``None`` for default theme. stderr (bool, optional): Use stderr rather than stdout if ``file`` is not specified. Defaults to False. file (IO, optional): A file object where the console should write to. Defaults to stdout. quiet (bool, Optional): Boolean to suppress all output. Defaults to False. width (int, optional): The width of the terminal. Leave as default to auto-detect width. height (int, optional): The height of the terminal. Leave as default to auto-detect height. style (StyleType, optional): Style to apply to all output, or None for no style. Defaults to None. no_color (Optional[bool], optional): Enabled no color mode, or None to auto detect. Defaults to None. tab_size (int, optional): Number of spaces used to replace a tab character. Defaults to 8. record (bool, optional): Boolean to enable recording of terminal output, required to call :meth:`export_html`, :meth:`export_svg`, and :meth:`export_text`. Defaults to False. markup (bool, optional): Boolean to enable :ref:`console_markup`. Defaults to True. emoji (bool, optional): Enable emoji code. Defaults to True. emoji_variant (str, optional): Optional emoji variant, either "text" or "emoji". Defaults to None. highlight (bool, optional): Enable automatic highlighting. Defaults to True. log_time (bool, optional): Boolean to enable logging of time by :meth:`log` methods. Defaults to True. log_path (bool, optional): Boolean to enable the logging of the caller by :meth:`log`. Defaults to True. log_time_format (Union[str, TimeFormatterCallable], optional): If ``log_time`` is enabled, either string for strftime or callable that formats the time. Defaults to "[%X] ". highlighter (HighlighterType, optional): Default highlighter. legacy_windows (bool, optional): Enable legacy Windows mode, or ``None`` to auto detect. Defaults to ``None``. safe_box (bool, optional): Restrict box options that don't render on legacy Windows. get_datetime (Callable[[], datetime], optional): Callable that gets the current time as a datetime.datetime object (used by Console.log), or None for datetime.now. get_time (Callable[[], time], optional): Callable that gets the current time in seconds, default uses time.monotonic. _environautoNFTz[%X]) color_systemforce_terminal force_jupyterforce_interactive soft_wraprstderrfilequietrgrhrno_colortab_sizerecordryemoji emoji_variantrxlog_timelog_pathlog_time_format highlighterrosafe_box get_datetimeget_timer@rC)rAr$r%r&r'rDrErFrGrrHrIrJrgrhrrKrLrMryrNrOrxrPrQrRrSHighlighterTyperorTrUrVc|||_|tn||_|jr| G|jd}|$|rt |} nt } | G|jd}|$|rt |} nt} ||_||_ ||_ ||_ ||_ ||_ |to|j n||_| G|jd}|+|rt ||jz } | ?|jd} | #| rt | } ||_| |_| |_|d|_|||_||_| |_||_|d|_n2|dkr||_nt2||_t5j|_t;||||_|pt>|_ ||_!|p tDj#|_$|ptJ|_&| |_'| | n|jdddk|_(|.|jd d}!|!|!d krd }n|!d krd }||j)o|j* n||_+t5j|_,t[t]| t^j0n||_1g|_2g|_3g|_4d |_5dS)NJUPYTER_COLUMNS JUPYTER_LINESCOLUMNSLINESrA) show_time show_path time_formatNO_COLORrTTY_INTERACTIVE0F1T)r/)6r@r# is_jupyterrisdigitrjJUPYTER_DEFAULT_COLUMNSJUPYTER_DEFAULT_LINESrLrM_markup_emoji_emoji_variant _highlightr>rorG_width_height_force_terminal_filerJrH _color_system_detect_color_system COLOR_SYSTEMS threadingRLockrr+ _log_render_null_highlighterrSrTrnowrUr rVrrKrris_dumb_terminalis_interactive_record_buffer_lockr.rHr%DEFAULT_thread_locals_record_buffer _render_hooks _live_stack_is_alt_screen)"rrCrDrErFrGrrHrIrJrgrhrrKrLrMryrNrOrxrPrQrRrSrorTrUrVr@jupyter_columns jupyter_linescolumnsrtty_interactives" r`rzConsole.__init__ksF  $DM+8+@+---m ? 3}"&-"3"34E"F"F".?3J3J3L3L.00EE3E~ $ 1 1/ B B  ,1F1F1H1H, //FF2F     6C#%# $ $ M%%g..E U]]__ U"   1#  %#1D     !%D   V # #!%!:!:!>NN   .0/1')#r_rzc(d|jd|jdS)Nz)rgrpr~s r`__repr__zConsole.__repr__s EEEd.@EEEEr_c|jp|jr tjn tj}t |d|}|t }|S)z Get the file object to write to.rich_proxied_file)rorHsysstdoutgetattrr")rrIs r`rIz Console.files@zHDKGcjjSZt0$77 <D r_new_filec||_dS)zSet a new file object.N)ro)rrs r`rIz Console.files r_c|jjSzGet a thread local buffer.)r|rr~s r`rzConsole._buffers"))r_c|jjSrr|r1r~s r` _buffer_indexzConsole._buffer_indexs"//r_valuec||j_dSrr)rrs r`rzConsole._buffer_index s+0(((r_c|jjS)z!Get the thread local theme stack.)r|r/r~s r` _theme_stackzConsole._theme_stacks"..r_cr|jr tjS|jr|jrdSt r@|jr tjSt}|jr tjn tj S|j dd }|dvr tjS|j dd }|d\}}}t |tj}|S)z"Detect color system from env vars.N COLORTERMr)r&24bitTERM-)rdr. TRUECOLORrrrxr<ror9r& EIGHT_BITr@rstriplower rpartition _TERM_COLORSSTANDARD)rwindows_console_features color_termterm _term_name_hyphencolorsrCs r`rqzConsole._detect_color_systems" ? )( ( 4#8 4  " +"**'C'E'E $,5+ %% *  **;;;AACCIIKKJ333",,=$$VR006688>>@@D*.//#*>*> 'J'++FK4HIIL r_c&|xjdz c_dS)z4Enter in to a buffer context, and buffer all output.r#N)rr~s r`rzConsole._enter_buffer-s ar_cN|xjdzc_|dS)z5Leave buffer context, and render content if required.r#N)r _check_bufferr~s r`rzConsole._exit_buffer1s. a r_liverJc|j5|j|t|jdkcdddS#1swxYwYdS)a`Set Live instance. Used by Live context manager (no need to call directly). Args: live (Live): Live instance using this Console. Returns: Boolean that indicates if the live is the topmost of the stack. Raises: errors.LiveError: If this Console has a Live context currently active. r#N)rrappendr)rrs r`set_livezConsole.set_live6sZ . .   # #D ) ) )t'((A- . . . . . . . . . . . . . . . . . .s2AA A cx|j5|jddddS#1swxYwYdS)zUClear the Live instance. Used by the Live context manager (no need to call directly).N)rrpopr~s r` clear_livezConsole.clear_liveFs Z # #   " " " # # # # # # # # # # # # # # # # # # /33hookcz|j5|j|ddddS#1swxYwYdS)zpAdd a new render hook to the stack. Args: hook (RenderHook): Render hook instance. N)rr~r)rrs r`push_render_hookzConsole.push_render_hookKs Z , ,   % %d + + + , , , , , , , , , , , , , , , , , ,s 044cx|j5|jddddS#1swxYwYdS)z'Pop the last renderhook from the stack.N)rr~rr~s r`pop_render_hookzConsole.pop_render_hookTs Z % %   " " $ $ $ % % % % % % % % % % % % % % % % % %rc.||S)z,Own context manager to enter buffer context.rr~s r`rzConsole.__enter__Ys  r_r exc_value tracebackc.|dS)zExit buffer context.N)r)rrrrs r`rzConsole.__exit__^s r_c.|dS)z`Begin capturing console output. Call :meth:`end_capture` to exit capture mode and return output.Nrr~s r`rzConsole.begin_capturebs r_cv||j}|jdd=||S)zhEnd capture mode and return captured string. Returns: str: Console output. N)rrr)r render_results r`rzConsole.end_capturefs> ++DL99 LO r_rrc>|j||dS)aPush a new theme on to the top of the stack, replacing the styles from the previous theme. Generally speaking, you should call :meth:`~rich.console.Console.use_theme` to get a context manager, rather than calling this method directly. Args: theme (Theme): A theme instance. inherit (bool, optional): Inherit existing styles. Defaults to True. rN)rrrrrs r`rzConsole.push_themeqs& $$UG$<<<<ED' ' 'DKl*FF    s&A??BBnew_sizec,|\}}||_||_dS)zvSet a new size for the terminal. Args: new_size (Tuple[int, int]): New width and height. N)rlrm)rrrgrhs r`rnz Console.sizes! v  r_c|jjS)zsGet the width of the console. Returns: int: The width (in characters) of the console. )rnrgr~s r`rgz Console.width syr_c||_dS)zFSet width. Args: width (int): New width. N)rl)rrgs r`rgz Console.width)s r_c|jjS)zpGet the height of the console. Returns: int: The height (in lines) of the console. )rnrhr~s r`rhzConsole.height2syr_c||_dS)zISet height. Args: height (int): new height. N)rm)rrhs r`rhzConsole.height;s r_cR|tjdS)z3Play a 'bell' sound (if supported by the terminal).N)controlr0bellr~s r`rz Console.bellDs  W\^^$$$$$r_c$t|}|S)aA context manager to *capture* the result of print() or log() in a string, rather than writing it to the console. Example: >>> from rich.console import Console >>> console = Console() >>> with console.capture() as capture: ... console.print("[bold magenta]Hello World[/]") >>> print(capture.get()) Returns: Capture: Context manager with disables writing to the terminal. )r)rcaptures r`rzConsole.captureHs$--r_rrrc(t||||S)aA context manager to display anything printed within a "pager". The pager application is defined by the system and will typically support at least pressing a key to scroll. Args: pager (Pager, optional): A pager object, or None to use :class:`~rich.pager.SystemPager`. Defaults to None. styles (bool, optional): Show styles in pager. Defaults to False. links (bool, optional): Show links in pager. Defaults to False. Example: >>> from rich.console import Console >>> from rich.__main__ import make_test_card >>> console = Console() >>> with console.pager(): console.print(make_test_card()) Returns: PagerContext: A context manager. )rrr)r)rrrrs r`rz Console.pagerYs*DfEJJJJr_r#rcj|dks Jd|t|dS)zqWrite new line(s). Args: count (int, optional): Number of new lines. Defaults to 1. rzcount must be >= 0N)rrrs r`rz Console.lineps6zzz/zzz 75>>"""""r_homec|r:|tjtjdS|tjdS)zClear the screen. Args: home (bool, optional): Also move the cursor to 'home' position. Defaults to True. N)rr0clearr)rrs r`rz Console.clearzsP  * LL',.. 9 9 9 9 9 LL ) ) ) ) )r_dotszstatus.spinnerg?g)@)spinner spinner_stylespeedrefresh_per_secondstatusrrrrrLc4ddlm}|||||||}|S)atDisplay a status and spinner. Args: status (RenderableType): A status renderable (str or Text typically). spinner (str, optional): Name of spinner animation (see python -m rich.spinner). Defaults to "dots". spinner_style (StyleType, optional): Style of spinner. Defaults to "status.spinner". speed (float, optional): Speed factor for spinner animation. Defaults to 1.0. refresh_per_second (float, optional): Number of refreshes per second. Defaults to 12.5. Returns: Status: A Status object that may be used as a context manager. r#rK)rrrrr)rrL)rrrrrrrLstatus_renderables r`rzConsole.statussG* #""""""F '1    ! r_rcf|jr)|tj|dSdS)zqShow or hide the cursor. Args: show (bool, optional): Set visibility of the cursor. TF)rrrr0r)rrs r`rzConsole.show_cursors6    LL,T22 3 3 34ur_enablecd}|jr7|js0|tj|d}||_|S)aEnables alternative screen mode. Note, if you enable this mode, you should ensure that is disabled before the application exits. See :meth:`~rich.Console.screen` for a context manager that handles this for you. Args: enable (bool, optional): Enable (True) or disable (False) alternate screen. Defaults to True. Returns: bool: True if the control codes were written. FT)rrrorr0 alt_screenr)rrchangeds r`rzConsole.set_alt_screensM   )D$7 ) LL+F33 4 4 4G"(D r_c|jS)zCheck if the alt screen was enabled. Returns: bool: True if the alt screen was enabled, otherwise False. )rr~s r` is_alt_screenzConsole.is_alt_screens ""r_titlecf|jr)|tj|dSdS)aSet the title of the console terminal window. Warning: There is no means within Rich of "resetting" the window title to its previous value, meaning the title you set will persist even after your application exits. ``fish`` shell resets the window title before and after each command by default, negating this issue. Windows Terminal and command prompt will also reset the title for you. Most other shells and terminals, however, do not do this. Some terminals may require configuration changes before you can set the title. Some terminals may not support setting the title at all. Other software (including the terminal itself, the shell, custom prompts, plugins, etc.) may also set the terminal window title. This could result in whatever value you write using this method being overwritten. Args: title (str): The new title of the terminal window. Returns: bool: True if the control code to change the terminal title was written, otherwise False. Note that a return value of True does not guarantee that the window title has actually changed, since the feature may be unsupported/disabled in some terminals. TF)rrrr0r)rrs r`set_window_titlezConsole.set_window_titles56    LLu-- . . .4ur_rrc*t|||pdS)auContext manager to enable and disable 'alternative screen' mode. Args: hide_cursor (bool, optional): Also hide the cursor. Defaults to False. style (Style, optional): Optional style for screen. Defaults to None. Returns: ~ScreenContext: Context which enables alternate screen on enter, and disables it on exit. r)rr)r)rrrs r`rzConsole.screensT{%+2NNNNr_rrrc@tj||p|j|}|S)aMeasure a renderable. Returns a :class:`~rich.measure.Measurement` object which contains information regarding the number of characters required to print the renderable. Args: renderable (RenderableType): Any renderable or string. options (Optional[ConsoleOptions], optional): Options to use when measuring, or None to use default options. Defaults to None. Returns: Measurement: A measurement of the renderable. )r6rr)rrr measurements r`measurezConsole.measures$"odG,Ct|ZPP r_c#K|p|j}|jdkrdSt|}t|dr,t |t s|||}nft |tr9|||j |j }|||}ntj d|d t|}n&#t$rtj d|dwxYwt}|}|D]3}t ||r|V|||Ed{V4dS) akRender an object in to an iterable of `Segment` instances. This method contains the logic for rendering objects with the console protocol. You are unlikely to need to use it directly, unless you are extending the library. Args: renderable (RenderableType): An object supporting the console protocol, or an object that may be converted to a string. options (ConsoleOptions, optional): An options object, or None to use self.options. Defaults to None. Returns: Iterable[Segment]: An iterable of segments that may be rendered. r#Nr)rxryzUnable to render zC; A str, Segment or object with __rich_console__ method is requiredzobject z is not renderable)rrqr:rrtyperr render_strrxryr$NotRenderableErroriter TypeErrorr=rr5) rrr_optionsrender_iterabletext_renderable iter_render_Segment render_outputs r`r5zConsole.renders"*dl   ! ! Fz** :1 2 2 :jRV;W;W (99$IIOO  C ( ( "ooh&8.O.>>tXNNOO+TJTTT   //KK   +?/???  ((**( @ @M-22 @#####;;}h??????????  @ @s C#C>)rpad new_linesrrc X|j5|p|j}|||}|rtj||}|j}|t d|}tttj ||j |||d|} |jx|jt| z } | dkr[|r'td|j z|tdgntd|j z|gg} | | | z| cdddS#1swxYwYdS)aGRender objects in to a list of lines. The output of render_lines is useful when further formatting of rendered console text is required, such as the Panel class which draws a border around any renderable object. Args: renderable (RenderableType): Any object renderable in the console. options (Optional[ConsoleOptions], optional): Console options, or None to use self.options. Default to ``None``. style (Style, optional): Optional style to apply to renderables. Defaults to ``None``. pad (bool, optional): Pad lines shorter than render width. Defaults to ``True``. new_lines (bool, optional): Include " " characters at end of lines. Returns: List[List[Segment]]: A list of lines, where a line is a list of Segment objects. Nr)include_new_linesrrrr) rrr5r= apply_stylerhrr r split_and_crop_linesrqrextend) rrrrrrrender_options _rendered render_heightr extra_linespad_lines r` render_lineszConsole.render_linesAs0Z& & $4 N J??I B#/ 5AA *1M( #A} 5 5 0!&0*3# !    E$0,3c%jj@ ?? ) R 'n.F(F N N '  #*#0H*H%"P"P!Q HLLK!7888M& & & & & & & & & & & & & & & & & & sD DD#&D#r)rrurvrNryrxrStextrurvrEcx|p |duo|j} |p |duo|j} |p |duo|j} | r't||| |j} || _|| _n+t| rt||jn||||} | r |p|j nd} | /| t| }| | |S| S)aConvert a string to a Text instance. This is called automatically if you print or log a string. Args: text (str): Text to render. style (Union[str, Style], optional): Style to apply to rendered text. justify (str, optional): Justify method: "default", "left", "center", "full", or "right". Defaults to ``None``. overflow (str, optional): Overflow method: "crop", "fold", or "ellipsis". Defaults to ``None``. emoji (Optional[bool], optional): Enable emoji, or ``None`` to use Console default. markup (Optional[bool], optional): Enable markup, or ``None`` to use Console default. highlight (Optional[bool], optional): Enable highlighting, or ``None`` to use Console default. highlighter (HighlighterType, optional): Optional highlighter to apply. Returns: ConsoleRenderable: Renderable object. N)rrNrO)default_variant)rurvr) rirhrk render_markuprjrurvrEr&rSr copy_styles)rr(rrurvrNryrxrS emoji_enabledmarkup_enabledhighlight_enabled rich_text _highlighterhighlight_texts r`rzConsole.render_strs8@%4-"?DK DFdN$Ct|%P)t*;*O  %#"1 I !(I !)I  %N49LMMMM!   I=NW 7t'7SW  #)\#i..99N  & &y 1 1 1! !r_)rPr*rPcht|tr|S |j|}|tj|}|jr|n|S#tj$r<}|| |cYd}~Stj d|d|dd}~wwxYw)a Get a Style instance by its theme name or parse a definition. Args: name (str): The name of a style or a style definition. Returns: Style: A Style object. Raises: MissingStyle: If no style could be parsed from name. NzFailed to get style z; ) rr>rrparselinkrr$StyleSyntaxError get_style MissingStyle)rr*rPrerrors r`r7zConsole.get_styles dE " " K %))$//E} D))#(:85::<<<5 8&   "~~g........%8t8888  s$A A&&B15B, B1B,,B1rurNryrxobjectsseprc dtdtfd}g} | jgj} dvrdtddffd } | t} |s ||jr|j} dfd } |D]}t|}t|tr$| | ||||| Jt|tr | |kt|tr| |||r'| d d l m}||| | | t|| |j(||jfd | D} | S)aCombine a number of renderables and text into one renderable. Args: objects (Iterable[Any]): Anything that Rich can render. sep (str): String to write between print data. end (str): String to write at end of print data. justify (str, optional): One of "left", "right", "center", or "full". Defaults to ``None``. emoji (Optional[bool], optional): Enable emoji code, or ``None`` to use console default. markup (Optional[bool], optional): Enable markup, or ``None`` to use console default. highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use console default. Returns: List[ConsoleRenderable]: A list of things to render. objrzc$ddlm}||S)z3Check if an object is expandable by pretty printer.r#) is_expandable)prettyr@)r>_is_expandables r`r@z3Console._collect_renderables..is_expandables' @ ? ? ? ? ?!>#&& &r_)rQrRrSrNc `t|ttdSr)r,r r-)r_appendrus r` align_appendz2Console._collect_renderables..align_appends-j${G*D*DEEFFFFFr_crFt}|dSdS)N)rur)rEjoinr)sep_textrrrur<r(s r` check_textz0Console._collect_renderables..check_textsV W#>>>x}}T**+++   r_)rNryrxrSr#)Pretty)rSc0g|]}t|Sr^r@r)rrs r` z0Console._collect_renderables..1s#SSS6*e44SSSr_rzN)objectrrrrvrkrSr:rrrrErrArJrr7)rr;r<rrurNryrxr@r append_textrEr1rIrrJrDrrr(s ``` @@@@r`_collect_renderableszConsole._collect_renderablessj4 'v '$ ' ' ' '02 $k  1 1 1 G GD G G G G G G G"F(9  ,*t*+L           " ; ;J":..J*c** ; OO"#%"+$0 $J-- ; J''''J(9:: ; z""""z** ; ******vvjlCCCDDDD LLZ99:::: : !NN4:..ESSSS{SSSKr_u─z rule.linerR) charactersralignrRrScZddlm}|||||}||dS)uDraw a line with optional centered title. Args: title (str, optional): Text to render over the rule. Defaults to "". characters (str, optional): Character(s) to form the line. Defaults to "─". style (str, optional): Style of line. Defaults to "rule.line". align (str, optional): How to align the title, one of "left", "center", or "right". Defaults to "center". r#)Rule)rrRrrSN)rulerUr)rrrRrrSrUrVs r`rVz Console.rule5sF t%Je5QQQ 4r_rc|jsA|5|jd|DddddS#1swxYwYdSdS)zInsert non-printing control codes. Args: control_codes (str): Control codes, such as those that may move the cursor. c3$K|] }|jV dSr)segment)r)_controls r` z"Console.control..Rs%#M#MH$4#M#M#M#M#M#Mr_N)rxrr!)rrs r`rzConsole.controlJs $ N N N ###M#MW#M#M#MMMM N N N N N N N N N N N N N N N N N N N Ns%<AArr)r<rrrxc |d|D}||||ddddd| dS)aOutput to the terminal. This is a low-level way of writing to the terminal which unlike :meth:`~rich.console.Console.print` won't pretty print, wrap text, or apply markup, but will optionally apply highlighting and a basic style. Args: sep (str, optional): String to write between print data. Defaults to " ". end (str, optional): String to write at end of print data. Defaults to "\\n". style (Union[str, Style], optional): A style to apply to output. Defaults to None. highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use console default. Defaults to ``None``. c34K|]}t|VdSr)r)r)_objects r`r[zConsole.out..gs("G"GG3w<<"G"G"G"G"G"Gr_FTrX)rrxrNryrwrvrVrN)rGr)rr<rrrxr; raw_outputs r`outz Console.outTsd&(("G"Gw"G"G"GGG    r_)r<rrrurvrwrNryrxrgrhrVrGnew_line_startrwrVrac |s|dkrtf}nd}| |j} | r |d}|d}d} |jdd}|5|||||||| }|D]}||}|j||| t| |jnt| ||| }g}|j }|j }||D]}||||n| |}tj}|D][}tj|||D]:\}}|tj|||r||;\|rit%d d |Dd kr'|d tj| r7|jj }tj||jd D] }||n|j |ddddS#1swxYwYdS)a[Print to the console. Args: objects (positional args): Objects to log to the terminal. sep (str, optional): String to write between print data. Defaults to " ". end (str, optional): String to write at end of print data. Defaults to "\\n". style (Union[str, Style], optional): A style to apply to output. Defaults to None. justify (str, optional): Justify method: "default", "left", "right", "center", or "full". Defaults to ``None``. overflow (str, optional): Overflow method: "ignore", "crop", "fold", or "ellipsis". Defaults to None. no_wrap (Optional[bool], optional): Disable word wrapping. Defaults to None. emoji (Optional[bool], optional): Enable emoji code, or ``None`` to use console default. Defaults to ``None``. markup (Optional[bool], optional): Enable markup, or ``None`` to use console default. Defaults to ``None``. highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use console default. Defaults to ``None``. width (Optional[int], optional): Width of output, or ``None`` to auto-detect. Defaults to ``None``. crop (Optional[bool], optional): Crop output to width of terminal. Defaults to True. soft_wrap (bool, optional): Enable soft wrap mode which disables word wrapping and cropping of text or ``None`` for Console default. Defaults to ``None``. new_line_start (bool, False): Insert a new line at the start if the output contains more than one line. Defaults to ``False``. rrNTrXFr:)rurvrgrhrwryrxrc3$K|] }|jV dSr)r(r)rYs r`r[z Console.print..s$II IIIIIIr_r#rr)rrGr~rQr5rrminrgrr!r5r7r=rsplit_lines_terminatorrrrrG splitlinesinsertrr )rr<rrrurvrwrNryrxrgrhrVrGrar; render_hooksrrr" new_segmentsr!r5r render_stylenew_liner add_new_line buffer_extends r`rz Console.printts2J d{{"99,  I  #D)!!!, 4 24 233#4K% D D"66{CC !\00!050Ac%,,,y#1N+-L!(F[F}"-??JF66*n==>>>>? $~~e44 "<>>"-::J.5.Lz>:://::*lw24FFGGG':(//999 : ;IILIIIIITTVVWW!''7<>>::: 2 $ 3 #8 $*%((D"M$''''(  ##L111i4 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 2sG%H33H7:H7ra) dataindentrx skip_keys ensure_asciicheck_circular allow_nanrP sort_keysjsonrprqrrrsrtrurvc ddlm} || |||||||| |  } nIA+==(.*?*N4;NN#) Aq%+==eVLLN!!*n!EE   1-----r_rrrrc|jstjdt|||}||}|j||dS)aUpdate lines of the screen at a given offset. Args: lines (List[List[Segment]]): Rendered lines (as produced by :meth:`~rich.Console.render_lines`). x (int, optional): x offset (column no). Defaults to 0. y (int, optional): y offset (column no). Defaults to 0. Raises: errors.NoAltScreen: If the Console isn't in alt screen mode. rN)rr$rrr5rr!r)rrrr screen_updaters r`rzConsole.update_screen_lines=sr! Y$%WXX X$UAq11 ;;}-- H%%% r_rNr^rgr%r word_wrap show_localssuppress max_framesr%rrrrc `ddlm}||||||||} || dS)a Prints a rich render of the last exception and traceback. Args: width (Optional[int], optional): Number of characters used to render code. Defaults to 100. 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. 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. r#) TracebackrN)rrr) rrgr%rrrrrrrs r`print_exceptionzConsole.print_exceptionQs[, )(((((I##!    9r_r currentframec|dz }|ddl}|}n |}|1|r||j}|dz}|r||J|jj|j|jfSddlm}||}|j|j |j jfS)a\Get caller frame information. Args: offset (int): the caller offset within the current frame stack. currentframe (Callable[[], Optional[FrameType]], optional): the callable to use to retrieve the current frame. Defaults to None, which will use ``inspect.currentframe()``. Returns: Tuple[str, int, Dict[str, Any]]: A tuple containing the filename, the line number and the dictionary of local variables associated with the caller frame. Raises: RuntimeError: If the stack offset is invalid. r#Nr)stack) inspectrf_backf_code co_filenamef_linenof_localsrfilenamelinenoframe)rrrrr frame_infos r`_caller_frame_infozConsole._caller_frame_infots& !    NNN((**EE LNNE   U. !  U.$$$<+U^U^K K % % % % % %J& (9:;K;TT Tr_) r<rrrurNryrx log_locals _stack_offsetrrc | stf} |jdd} |5|| ||||||} fd| D} || \} }}| drdnt j| }| t j d}|rDddl m }d| D}| ||d ||| |||| g} | D]}|| } g}|j}|j}|j}| D]}|||||jj}t+j||jd D] }|| ddddS#1swxYwYdS)aXLog rich content to the terminal. Args: objects (positional args): Objects to log to the terminal. sep (str, optional): String to write between print data. Defaults to " ". end (str, optional): String to write at end of print data. Defaults to "\\n". style (Union[str, Style], optional): A style to apply to output. Defaults to None. justify (str, optional): One of "left", "right", "center", or "full". Defaults to ``None``. emoji (Optional[bool], optional): Enable emoji code, or ``None`` to use console default. Defaults to None. markup (Optional[bool], optional): Enable markup, or ``None`` to use console default. Defaults to None. highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use console default. Defaults to None. log_locals (bool, optional): Boolean to enable logging of locals where ``log()`` was called. Defaults to False. _stack_offset (int, optional): Offset of caller from end of call stack. Defaults to 1. Nr:c0g|]}t|Sr^r@rLs r`rMzConsole.log..s#WWWZvj%88WWWr_.s@"U>>$//r_z [i]locals)r)rPpathline_no link_pathFre)rr~rQrr}rrabspathrr<scoperitemsrrurUr5r!r5rrr=r rg)rr<rrrurNryrxrrr;rjrrrlocalsrrr locals_maprrkr!r5r"rrors ` r`logz Console.logs8 #yylG)!!!, 0 $0 $33#4K WWWW;WWW (,(?(? (N(N %Hgv ( 3 3C 8 8Wbgooh>W>WI&&rv..r2D P//////&,llnn ""<< +#N#N#NOOO  !..00#' ! K% D D"66{CC *,L!(F[F!\N) ; ; vvj.99:::: L/M4dje $ $ d#### $[0 $0 $0 $0 $0 $0 $0 $0 $0 $0 $0 $0 $0 $0 $0 $0 $0 $0 $sFGG G cd|_tjtjtj}tj|t jtd)alThis function is called when a `BrokenPipeError` is raised. This can occur when piping Textual output in Linux and macOS. The default implementation is to exit the app, but you could implement this method in a subclass to change the behavior. See https://docs.python.org/3/library/signal.html#note-on-sigpipe for details. Tr#) rJropendevnullO_WRONLYdup2rrfileno SystemExit)rrs r`on_broken_pipezConsole.on_broken_pipesL '"*bk22 **,,---mmr_c|jr |jdd=dS |dS#t$r|YdSwxYw)aQCheck if the buffer may be rendered. Render it if it can (e.g. Console.quiet is False) Rendering is supported on Windows, Unix and Jupyter environments. For legacy Windows consoles, the win32 API is called directly. This method will also record what it renders if recording is enabled via Console.record. N)rJr _write_bufferBrokenPipeErrorrr~s r`rzConsole._check_bufferss :  QQQ F "     " " "    ! ! ! ! ! ! "s+A  A c 6|j5|jrM|jsF|j5|j|jdddddn #1swxYwY|jdkr|jrCddlm }||j| |jdd|jdd=nNtrd}|j rt|j}| |tv}|rfddlm}ddlm}|jdd}|jr(|jr!t-t/j|}||||jn| |jdd}|jj}d} t5|| kr ||ng} | j} d} |d D]k} | t5| z| kr6| r4|d | | d} | | | t5| z } l| r2|d | | n#t>$r}|j d |_ d}~wwxYw| |jdd} |j|n"#t>$r}|j d |_ d}~wwxYw|j!|jdd=ddddS#1swxYwYdS) z$Write the buffer to the output file.Nrr#)displayF)LegacyWindowsTerm)legacy_windows_renderi TrzG *** You may need to add PYTHONIOENCODING=utf-8 to your environment ***)"rrMrrzr}r!rrdjupyterrrr<ror)rIrrich._win32_consolerrich._windows_rendererrrKrpr r= remove_colorwriterrrhrGrUnicodeEncodeErrorreasonflush)rruse_legacy_windows_renderrrrrr(r MAX_WRITEbatch batch_appendrnrr9s r`rzConsole._write_buffer sLZD (D ({ @4#5 @-@@'..t|AAA???@@@@@@@@@@@@@@@!Q&&?>(000000GDL$*=*=dl111o*N*NOOO QQQ5"491."%/ %:%:F%1$*.A$A!:5%&MMMMMMTTTTTT%)\!!!_F#}L1CL)-g.B6.J.J)K)K11&:K:KDI:V:VWWWW$(#6#6t|AAA#G#GD%)IOE(6I&#&t99 #9#9$)E$KKKK79E38.sR&eQ,1:U\\$'''dr_c32K|]}|j |jVdSr)rr(rds r`r[z&Console.export_text..s@"?Lr_N)rMrzrGr})rrrr(s r` export_textzConsole.export_texts K W W V W W W % + + ww*.*= ww#'#6  +'* + + + + + + + + + + + + + + + sAA==BBrc|||}t|dd5}||ddddS#1swxYwYdS)aGenerate text from console and save to a given location (requires record=True argument in constructor). Args: path (Union[str, PathLike[str]]): Path to write text files. clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``. styles (bool, optional): If ``True``, ansi style codes will be included. ``False`` for plain text. Defaults to ``False``. rwrrsN)rrr)rrrrr( write_files r` save_textzConsole.save_texts eF;; $g . . . #*   T " " " # # # # # # # # # # # # # # # # # #sA  AArr code_format inline_stylesrrc :ddlm}|js Jdg}|j}|pt}d} |t n|} |j5|rtjtj |j D]U\} } } || } | r7| |}| j rd| j d| d} |r d |d| d n| } || Vni}tjtj |j D]{\} } } || } | r]| |}| |t|d z}| j rd |d | j d| d} n d|d| d } || |g}|j}|D]\}}|r|d|d|dd|} | d|| |jj|jj}|r |j dd=dddn #1swxYwY|S)aIGenerate HTML from console contents (requires record=True argument in constructor). Args: theme (TerminalTheme, optional): TerminalTheme object containing console colors. clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``. code_format (str, optional): Format string to render HTML. In addition to '{foreground}', '{background}', and '{code}', should contain '{stylesheet}' if inline_styles is ``False``. inline_styles (bool, optional): If ``True`` styles will be inlined in to spans, which makes files larger but easier to cut and paste markup. If ``False``, styles will be embedded in a style tag. Defaults to False. Returns: str: String containing console contents as HTML. rescaperrNz zz .get_svg_styleR sy ##"5))IK'5;+A'''[..v66 M)U]-E)'']0088  } 0!(%wy 7!%#66   1ei11 2 2 2z 6  !4555| 8  !6777 @  !>???| C  !ABBB((9%%C!$K Jr_gQ?r#(rBr(cB|ddS)z.HTML escape text and replace spaces with nbsp.rz )replace)r(rs r` escape_textz'Console.export_svg..escape_text s!6$<<''X66 6r_r*rattribsc dtdtfddfd|D}|rd|d|d|d|d nd|d|d S) z.Make a tag from name, content, and attributes.rrzcjt|trt|dSt|S)Ng)rfloatrr)rs r` stringifyz7Console.export_svg..make_tag..stringify s0ee--.!%---5zz!r_rc3K|]?\}}|dddd|dV@dS)rrz=""N)lstripr)r)kvr#s r`r[z7Console.export_svg..make_tag.. sn##Aq88C==((c22EEiillEEE######r_rrz)rOrrGr)r*rr tag_attribsr#s @r`make_tagz$Console.export_svg..make_tag s  " "C " " " " ((#####MMOO###K 0;D;;;;;;;D;;;;/// /// r_z terminal-rc34K|]}t|VdSr)reprrds r`r[z%Console.export_svg.. s(CCwT']]CCCCCCr_rrX)lengthrTrect?? crispEdges)fillrrrgrhshape_renderingrrzurl(#-line-))_classrr textLength clip_pathc g|] }|zdz S)r0r^)r)r line_heights r`rMz&Console.export_svg.. s#LLL+-3LLLr_rc3^K|]'\}}dd|ddd|zdzdV(dS) z r/rr1)rrrgrhz Nr^)r)rr char_widthr;r*rrgs r`r[z%Console.export_svg.. s    y     XfV:+=kTXFXYYY         r_c36K|]\}}dd|d|dVdS).z-rz { z }Nr^)r)rrule_nors r`r[z%Console.export_svg.. sT  7CsG 2 2 2W 2 2# 2 2 2      r_zrgba(255,255,255,0.35)rc)r3stroke stroke_widthrrrgrhrxz-titlemiddlera)r7r3 text_anchorrrz )rr= char_heightr;terminal_widthterminal_heightrgrh terminal_x terminal_yrchrome backgroundsmatrixrr)$zlibrr rich.cellsrr>rrCrgrrOrzr r=rr}radler32rGencoderr rr rrr rr rrrrangerr r):rrrrrrrrOrrrG margin_top margin_right margin_bottom margin_left padding_top padding_rightpadding_bottom padding_left padding_widthpadding_height margin_width margin_heighttext_backgrounds text_groupclassesstyle_norrrrrr(rrZrules class_namehas_backgroundrr text_length line_offsetsrrrMrNrHrIrL title_colorsvgrr=rr;r*rrgs: ` @@@@@@@r` export_svgzConsole.export_svg0 s6  ''''''(*   3       B**   #44 !D(        $}4 $~5"\1 "]2 &( " "$ 7c 7c 7 7 7 7 7 7 15    (  AG      ( % , ,G243FGGHHH ,#))+++ , , , , , , , , , , , , , , ,  #c WWCC(CCCCCKK ll7H55 6''I  !=hu!U!U!UVV4 $4 $GAtA)-2 $2 $%eX(% e,,''%-GENMH111 =%)N!;./33"[66v>>BJ $mG%,D%8%SAS=SN!=0/33"]88@@D 'htnn ! $++ "!+*n+o3",{":#.#5,8   3T?**%% "'K--&/#>#>*#>#>*n+o ;'1CII'=&Ci&C&Cq&C&C&C   XXd^^#e2 $hMLLL588LLL          $-\#:#:          GN}}     gg.// $$ej0=@AAq5K/.@ (,+ "    -1   hh E""#+++ $ A%{*Q. F     !##%-1Uk1A5 </"]2"\1!K/#!  " sADDDc|||||||}t|dd5} | |ddddS#1swxYwYdS)aMGenerate an SVG file from the console contents (requires record=True in Console constructor). Args: path (Union[str, PathLike[str]]): The path to write the SVG to. title (str, optional): The title of the tab in the output image theme (TerminalTheme, optional): The ``TerminalTheme`` object to use to style the terminal clear (bool, optional): Clear record buffer after exporting. Defaults to ``True`` code_format (str, optional): Format string used to generate the SVG. Rich will inject a number of variables into the string in order to form the final SVG output. The default template used and the variables injected by Rich can be found by inspecting the ``console.CONSOLE_SVG_FORMAT`` variable. font_aspect_ratio (float, optional): The width to height ratio of the font used in the ``code_format`` string. Defaults to 0.61, which is the width to height ratio of Fira Code (the default font). If you aren't specifying a different font inside ``code_format``, you probably don't need this. unique_id (str, optional): unique id that is used as the prefix for various elements (CSS styles, node ids). If not set, this defaults to a computed value based on the recorded content. rrrrN)rkrr) rrrrrrrrrjrs r`save_svgzConsole.save_svg. s6oo#/   $g . . . "*   S ! ! ! " " " " " " " " " " " " " " " " " "sAAArN)rzrrrr)TNrr)rr)~r[r\r]rirrr@rrrkr3rrrrGrrjr?r1rr*rrr"rrrrIsetterrr=rrrHrr.rqrrrrr3rrrrrrrrrrrrCrsrrrxrmrrfrnrrgrhrrrr8rrrrrrrrrr rr6rrr5r>r'rrrWrr7rrQrFr-rVr0rr`rr}r;rrrr staticmethodr rrrrrrrrrrr rrDrr'rr(rkrmr^r_r`rrEs!!F#%*Hgc3h,,, )-(,,0!%"&# $%)#'04:@3B?3D3D)-9=2604AD$D$D$ E F D$ ! D$ ~D$$D>D$D$D$D$r#wD$D$}D$ D$  "!D$"4.#D$$%D$&'D$()D$*+D$, --D$./D$01D$23D$4s$6675D$6/07D$8!9D$:;D$<xH 56=D$>8BI./?D$@738,-AD$D$D$D$LF#FFFFbgX [RW[*g***X*0s000X013141111/j///X/ h{&;    0     .V..... #### ,Z,D,,,,%%%%   S    ;? = = = =4 =4 = = = =&&&&:> 2 2 2u 2$ 2, 2 2 2 2 hsm   X L#LLLXL-T---X-^ ,$ , , ,X ,      X  & '& & & X& P [U38_[sX \34\    X  ]ST]%%%%$RWKKe_K59KJNK KKKK.####d#### * *$ *$ * * * *#3$(!!!! ! ! !  !"! !!!!B       TT*#t###X#cdBFJ O O O/7 /B O  O O O ORV(6>~6N $OS1@1@(1@3;N3K1@ ' 1@1@1@1@l-1> "&>>>">.)>  >  >> d7m >>>>H$&+/-1 $!%$(15;;;;S%Z ; -( ; >* ;~;;D>;o.; ;;;;|RV#u*%3;E%*W  WWWWv #.%   S%Z    *NNDNNNN-1$(        c5j)*  D>       F-1+/-1"& $!%$(# $$($!h2h2h2h2h2 h2 c5j)* h2 -( h2>*h2$h2~h2h2D>h2}h2 h2h2D>h2 !h2" #h2h2h2h2X#;4()"#26;4;4;4sm;4 ;4 dCn% ;4  ;4;4;4;4;4(C5#:./;4;4 ;4;4;4;4B$(,0 . . ." . . .) .  . . . .F@A$w-(-09< . ##!57!!!}! ! } !  !!5j12!! !!!!FQU$U$U$U#+HR)9L5L,M#N$U sCc3h' ($U$U$U\$UR-1+/ $!%$( Q$Q$Q$Q$Q$ Q$ c5j)* Q$ -( Q$~Q$Q$D>Q$Q$Q$ Q$Q$Q$Q$f     " " " "G(G(G(G(RXg%634"#'"""" "  "  " " """"H,0D#H ###C#&'# #  #  ####.*.%)# KKK &K K c] K  K KKKKb*..####C#&'# & #  #  ## ####D)--#'#'|||| & |  |  |!|C=| ||||D)--#'#'$"$"$"C#&'$" $"  & $"  $"$"!$"C=$" $"$"$"$"$"$"r_r__main__)rMzJSONRPC [i]request[/i]g?Fz2.0subtract*)minuend subtrahendr)jsonrpcrparamsidz Hello, World!z{'a': 1}z&Which one is correct team name in NBA?)zNew York BullszLos Angeles KingszGolden State Warriors Huston Rocketrz)questionranswer)answeredq1z 5 + 7 = ?) rz 12 - 8 = ?)r#rarr)r}r~q2)sportmaths)r*emptyquizr)rzrI)rrrsabcrr dataclassesrrr functoolsr itertoolsr mathr r timer typesr rrtypingrrrrrrrrrrrrrrrrr r!rich._null_filer"rr$r%r&_export_formatr'r(_filenor)rur*r+rSr,r-r r.r/rr0rNr1rSr2r3ryr5r+rr6r7rr8r9protocolr:r~r;rr<rYr=rr>r?styledrAterminal_themerBrCrDr(rErFrrGrHr:rIrrJrrLrfrgplatformr<rrWrrrZr __stdin__r _STDIN_FILENO Exception __stdout___STDOUT_FILENO __stderr___STDERR_FILENOrrrrrrfrmrrrrrvrrrrrrrrrrr#rrrrrlocalr.r3r6rkr9r>rr[rrr,rr^r_r`rsN  ########((((((((6666666666*&%%%%%******CCCCCCCC66666666%%%%%%%%))))))))99999999++++++55555555%%%%%%%%########SSSSSSSSSS $$$$$$$$000000 ,' !E#v+./78DE =>         HJJ M((**MMMMM^**,,NNNNN^**,,NNNNN~~> %~6 "%# ..... ... BBBBBBB BJ     x           ((C78:ng567 #O%%333339333 ) ) ) ) ) ) ) )$B!!!!!!!!*$%$%$%$%$%$%$%$%N,/,/,/,/,/,/,/,/^$$$$$$$$BtxXc5j-A(AB,T*$  &"  PO9L9L9N9NOOO )/         &AE8$<=DDD%%%%=t==== M "M "M "M "M "M "M "M "`@ zgT"""G KK       "$B77       KKTT']];;; MM!%$L$$$ #2    !&$/#3#3#3"$ %1#/<<"#    !!!!!)s66FFFF88GGG G*)G*