}BFj,dZddlZddlZddlZddlmZddlmZm Z ddl m Z ddl m Z mZddlmZmZddlmZdd lmZdd lmZmZmZdd lmZdd lmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&mZm'Z'm(Z(m)Z)m*Z*dd l+m,Z,ddl-m.Z.ddl/m0Z0m1Z1ddl2m3Z3m4Z4m5Z5ddl6m7Z7ddl8m9Z9ddl:m;Z;mZ>ddl?m@Z@ddlAmBZBmCZCmDZDddlEmFZFmGZGddlHmIZImJZJddlKmLZLddlMmNZNddlOmPZPmQZQddlRmSZSddlTmUZUddlVmWZWmXZXmYZYdd lZm[Z[m\Z\dd!l]m^Z^m_Z_m`Z`maZambZbmcZcdd"ldmeZemfZfdd#lgmhZhmiZiGd$d%eNZjd&ekd'ekd(ekfd)Zld*Zmd+D]CZneoeenZp epr eqepd,reprsd-Zsn6#et$rd-ZsYnwxYwd.Zsd/ejuvpes Zvd0Zwd1ZxGd2d3e9ZyGd4d5e Zzej{eze|d6kr(ez}~dSdS)7z/IPython terminal interface using prompt_toolkitN)warn)UnionOptional)get_asyncio_loop)InteractiveShellInteractiveShellABC)&display_formatter_default_active_typesterminal_default_mime_renderers)input) theme_table)toggle_set_term_titleset_term_titlerestore_term_title) abbrev_cwd)AnyBoolDictEnumFloatInstanceIntegerListTypeUnicoderdefaultobservevalidateDottedObjectName) import_item)AutoSuggestFromHistory)DEFAULT_BUFFER EditingMode)HasFocus ConditionIsDone)PygmentsTokens)History)ConditionalProcessor!HighlightMatchingBracketProcessor) ColorDepth) patch_stdout) PromptSession CompleteStyleprint_formatted_text) DynamicStyle merge_styles)style_from_pygments_clsstyle_from_pygments_dict)get_style_by_name)Style) TerminalPdbPdb)TerminalMagics)get_inputhook_name_and_func)PromptsClassicPromptsRichPromptDisplayHook)IPythonPTCompleterIPythonPTLexer) KEY_BINDINGSUNASSIGNED_ALLOWED_COMMANDScreate_ipython_shortcutscreate_identifierRuntimeBinding add_binding)KEYBINDING_FILTERSfilter_from_string)NavigableAutoSuggestFromHistoryAppendAutoSuggestionInAnyLineceZdZdS)_NoStyleN)__name__ __module__ __qualname__OC:\PYTHON\_runtimes\venv\Lib\site-packages\IPython/terminal/interactiveshell.pyrJrJIsDrOrJwidthlineno wrap_countcRtj|}i}tj|j}dtj|jvs0td|jDr||d<dtj|jvs0td|jDr||d<dtj|jvs0td|jDr||d<||fi|S)z~ Sagemath use custom prompt and we broke them in 8.19. make sure to pass only width if method only support width rRc.g|]}|j|jkSrNkind VAR_KEYWORD.0ps rP z?_backward_compat_continuation_prompt_tokens..Z!BBBQ1= BBBrO line_numberc.g|]}|j|jkSrNrVrYs rPr\z?_backward_compat_continuation_prompt_tokens..^r]rOrSc.g|]}|j|jkSrNrVrYs rPr\z?_backward_compat_continuation_prompt_tokens..cr]rO)inspect signature parametersanyvalues)methodrQrRrSsigextraparamss rP+_backward_compat_continuation_prompt_tokensrjNs@  F # #C E  v & & 1F7$V,,7773BB#.*?*?*A*ABBB<<7!h)&11<<<BB#.*?*?*A*ABBBAA< &mw(00;;;sBB#.*?*?*A*ABBB@@;)l 6% ! !5 ! !!rOc tjdS#t$rYnt$rt dYnwxYwtjdkrdSdS)NEDITORzN$EDITOR environment variable is not pure ASCII. Using platform default editor.posixvinotepad)osenvironKeyError UnicodeErrorrnamerNrOrPget_default_editorruis z(##                 w'tys ;;;)stdinstdoutstderrisattyFTIPY_TEST_SIMPLE_PROMPTcddl}|||}|ds|dr |dd}|S)z We do not need to protect against error, this is taken care at a higher level where any reformat error is ignored. Indeed we may call reformatting on incomplete code. rN)mode )black format_strFileModeendswith)text_before_cursorrformatted_texts rPblack_reformat_handlerrso LLL%%&8u~~?O?O%PPN  & &t , ,-1H1H1N1N-', rOcddlm}ddlm}|t j}|||\}}|r6|ds|dr |dd}|S|S)Nr)file_resources)yapf_api) style_configr}r~) yapf.yapflibrrGetDefaultStyleForDirrpgetcwd FormatCoder)rrrrr was_formatteds rPyapf_reformat_handlerrs++++++%%%%%%!77 DDL$,$7$7%8%%!NM"!**400 1^5L5LT5R5R 1+CRC0N!!rOcDeZdZdZfdZdZdZdZdeddfd Z xZ S) PtkHistoryAdapterzs Prompt toolkit has it's own way of handling history, Where it assumes it can Push/pull from history. c~t||_|dSN)super__init__shell_refresh)selfr __class__s rPrzPtkHistoryAdapter.__init__s1   rOc<d|_|dSNF)_loadedrrstrings rP append_stringzPtkHistoryAdapter.append_strings  rOcd|js(t||_dSdSr)rlistload_history_strings_loaded_stringsrs rPrzPtkHistoryAdapter._refreshs;| E#'(A(A(C(C#D#DD  E ErOc#Kd}g}|jj|jjdD]9\}}}|}|r||kr|||}:|dddEd{VdS)NT)include_latestr~)rhistory_managerget_tailhistory_load_lengthrstripappend)r last_cellres_____cells rPrz&PtkHistoryAdapter.load_history_stringss !Z7@@ J *4A   ! !MBT;;==D !** 4    ttt9rOrreturnNcdSrrNrs rP store_stringzPtkHistoryAdapter.store_strings rO) rKrLrM__doc__rrrrstrr __classcell__rs@rPrrs   EEE    3 4        rOrc ~ eZdZUedZedddZedddZdZ e e dfe d <dZ e eedfe d <dZed d dZeed dZedZedddZedddZedddZedddZedddZedddZeddddZedddZ edddZ!e"ede#e$gddZ%e&d d!Z'e(d d"Z)d#Z*e(d$d%Z+e(d&e(d'd(Z,d)Z-ed*dZ.edd+dZ/ee0d,dZ1e#e2d-dZ3e4e2Z5e6d.d/Z7e6d0d1Z8edd2dZ9ed3d4dZ:e;d5d6d78dZ<edd9dZ=edd:dZ>e?dd;dZ@edd<dZAed=d>ddZBe?e d?<eid@dZCeDdAdBdZEe?e dC<e(dDdEZFeDdddFGdZGdZHe?e dH<e(dIdJZIdwdKZJe(dLdMZKeLee;gdNeeLeeeLeeeddNOdPMdQNdReODSTdZPe(dUdVZQdWZReddXdZSedYdZdZTe(d[dwd\ZUd]ZVfd^ZWd_ZXd`ZYedaZZedbZ[dce\dde\dee\fdfZ]dgZ^dhZ_diZ`fdjZafdkZbdxfdm ZcdnZddZedoZfdpZgdZhdqZidZjekele dr<dwdsekeldldfdtZmenjoZpduZqdZrdvZsxZtS)yTerminalInteractiveShellT)configz@minimum characters for filling with ellipsis in file completions)helpzNumber of line at the bottom of the screen to reserve for the tab completion menu, search history, ...etc, the height of these menus will at most this value. Increase it is you prefer long and skinny menus, decrease for short and wide.Npt_app auto_suggestz ~/.pdbhistoryz'File in which to store and read historyaUse `raw_input` for the REPL, without completion and prompt colors. Useful when controlling IPython as a subprocess, and piping STDIN/OUT/ERR. Known usage are: IPython's own testing machinery, and emacs' inferior-python subprocess (assuming you have set `python-shell-interpreter` to "ipython") available through the built-in `M-x run-python` and third party packages such as elpy. This mode default to `True` if the `IPY_TEST_SIMPLE_PROMPT` environment variable is set, or the current terminal is not a tty. Thus the Default value reported in --help-all, or config will often be incorrectly reported. c,|jrtntSr) simple_promptr7r6rs rP debugger_clsz%TerminalInteractiveShell.debugger_clss(9ssk9rOz Set to confirm when you try to exit IPython with an EOF (Control-D in Unix, Control-Z/Enter in Windows). By typing 'exit' or 'quit', you can force a direct exit without any confirmation.emacsz5Shortcut style to use at the prompt. 'vi' or 'emacs'.z;Add shortcuts from 'emacs' insert mode to 'vi' insert mode.z Cursor shape changes depending on vi mode: beam in vi insert mode, block in nav mode, underscore in replace mode.g{Gz?zJThe time in milliseconds that is waited for a key code to complete.g?zUThe time in milliseconds that is waited for a mapped key sequence to complete.zMAutoformatter to reformat Terminal code. Can be `'black'`, `'yapf'` or `None`)r allow_noneFz Automatically add/delete closing bracket or quote when opening bracket or quote is entered/deleted. Brackets: (), [], {} Quotes: '', "" zQEnable mouse support in the prompt (Note: prevents selecting text with the mouse)legacy)klasszDeprecated, and has not effect, use IPython themes The name or class of a Pygments style to use for syntax highlighting. To see available styles, run `pygmentize -L styles`. editing_modec,|ddkrd|d<n#|ddkrd|d<tt|dr|dS|jS)Nvaluevimrnrr)lowerhasattrr"upperr)rproposals rP_validate_editing_modez/TerminalInteractiveShell._validate_editing_mode?s G  " " $ $ - -#HW   g  $ $ & &) 3 3&HW  ; 1 7 7 9 9 : : -G$**,, ,  rOc|jr8tt|j|j_dSdSr)rgetattrr"newrrrchanges rP _editing_modez&TerminalInteractiveShell._editing_modeKsA ; P'.{FJz9TerminalInteractiveShell._set_formatter..RsQrOryapf)reformat_handlerrr ValueError)r formatters rP_set_formatterz'TerminalInteractiveShell._set_formatterPsP  $.JD ! ! ! ' ! !$:D ! ! ! & $9D ! ! ! rO autoformatterc>|j}||dSr)rr)rrrs rP_autoformatter_changedz/TerminalInteractiveShell._autoformatter_changedZs#J  I&&&&&rOhighlighting_stylecolorsc|j|jksJ|jdkrtddSdS)NrzLhighlighting_style is deprecated since 9.0 and have no effect, use themeing.)rrrrs rP_highlighting_style_changedz4TerminalInteractiveShell._highlighting_style_changed_sVzVZ--////// : ! ! ^    F " !rOc:|d|_dS)Nr)_make_style_from_name_or_cls_stylers rP refresh_stylez&TerminalInteractiveShell.refresh_styleis77AA rOz0Override highlighting format for specific tokenszUse 24bit colors instead of 256 colors in prompt highlighting. If your terminal supports true color, the following command should print ``TRUECOLOR`` in orange:: printf "\x1b[38;2;255;100;0mTRUECOLOR\x1b[0m\n" z?Set the editor used by IPython (default to $EDITOR/vi/notepad).z6Class used to generate Prompt token for prompt_toolkitpromptsc,||Sr) prompts_classrs rP_prompts_defaultz)TerminalInteractiveShell._prompts_defaults!!$'''rOdisplayhook_classctSr)r<rs rP_displayhook_class_defaultz3TerminalInteractiveShell._displayhook_class_defaults$$rOz$Automatically set the terminal titlezIPython: {cwd}zlCustomize the terminal title format. This is a python format string. Available substitutions include {cwd}.)column multicolumn readlinelikezOptions for displaying tab completions, 'column', 'multicolumn', and 'readlinelike'. These options are for `prompt_toolkit`, see `prompt_toolkit` documentation for more information.r)r default_valuezHighlight matching brackets.zEnable vi (v) or Emacs (C-X C-E) shortcuts to open an external editor. This is in addition to the F2 binding, which is always enabled.zProvide an alternative handler to be called when the user presses Return. This is an advanced option intended for debugging, which may be changed or removed in later releases.z:Allows to enable/disable the prompt toolkit history searchrGaSpecifies from which source automatic suggestions are provided. Can be set to ``'NavigableAutoSuggestFromHistory'`` (:kbd:`up` and :kbd:`down` swap suggestions), ``'AutoSuggestFromHistory'``, or ``None`` to disable automatic suggestions. Default is `'NavigableAutoSuggestFromHistory`'._autosuggestions_provideru Extra arguments to pass to `llm_provider_class` constructor. This is used to – for example – set the `model_id` input_historyaX Fully Qualifed name of a function that takes an IPython history manager and return a prefix to pass the llm provider in addition to the current buffer text. You can use: - no_prefix - input_history As default value. `input_history` (default), will use all the input history of current IPython session _llm_prefix_from_historyllm_prefix_from_historycJ|j}||_|dSr)rr_set_autosuggestions)rrrts rP _llm_prefix_from_history_changedz9TerminalInteractiveShell._llm_prefix_from_history_changeds)z(,% !!#####rOax Provisional: This is a provisional API in IPython 8.32, before stabilisation in 9.0, it may change without warnings. class to use for the `NavigableAutoSuggestFromHistory` to request completions from a LLM, this should inherit from `jupyter_ai_magics:BaseProvider` and implement `stream_inline_completions` )rr_llm_provider_classllm_provider_classcJ|j}||_|dSr)rrr)rrprovider_classs rP_llm_provider_class_changedz4TerminalInteractiveShell._llm_provider_class_changeds)#1  !!#####rOc|j}jr3tjtrj|d_n|dkrt _n~|dkrijrfd}nd}t_|j_j}|dkrd}|}n|dkrd}|}nt|}|j_ ntdj rjj _dSdS) Nr rGcFtj}|dijS)NrN)rrllm_constructor_kwargs)llm_provider_constructorrs rPinit_llm_providerzHTerminalInteractiveShell._set_autosuggestions..init_llm_providers./:4;S/T/T,33RRd6QRRRrO no_prefixcdS)NrrNrs rPrz@TerminalInteractiveShell._set_autosuggestions..no_prefixs2rOrcjdd|DdzS)Nr}cg|] }|d S)rN)rZss rPr\zXTerminalInteractiveShell._set_autosuggestions..input_history..s%P%P%Pqad%P%P%PrO)join get_ranger s rPrzDTerminalInteractiveShell._set_autosuggestions..input_historys599%P%PO4M4M4O4O%P%P%PQQTXXXrOzNo valid provider.) autosuggestions_providerr isinstancerG disconnectr r_init_llm_providerrr _llm_prefixerrr)rproviderrrtrfunrs` rPrz-TerminalInteractiveShell._set_autosuggestionss{  4H   +  >" "  +   ( ( * * *   $D   1 1 1 6 8 8D   : : :' )SSSSSS %)! ? A AD 3DD  0/D{"" ((YYY$"$''.1D  + +122 2 ; 9'+'8DK $ $ $ 9 9rOrc>|j}||dSr)rr)rrrs rP!_autosuggestions_provider_changedz:TerminalInteractiveShell._autosuggestions_provider_changed%s#: !!(+++++rO)command match_keys match_filternew_keys new_filtercreate) key_traitper_key_traitsa Add, disable or modifying shortcuts. Each entry on the list should be a dictionary with ``command`` key identifying the target function executed by the shortcut and at least one of the following: - ``match_keys``: list of keys used to match an existing shortcut, - ``match_filter``: shortcut filter used to match an existing shortcut, - ``new_keys``: list of keys to set, - ``new_filter``: a new shortcut filter to set The filters have to be composed of pre-defined verbs and joined by one of the following conjunctions: ``&`` (and), ``|`` (or), ``~`` (not). The pre-defined verbs are: {filters} To disable a shortcut set ``new_keys`` to an empty list. To add a shortcut add key ``create`` with value ``True``. When modifying/disabling shortcuts, ``match_keys``/``match_filter`` can be omitted if the provided specification uniquely identifies a shortcut to be modified/disabled. When modifying a shortcut ``new_filter`` or ``new_keys`` can be omitted which will result in reuse of the existing filter/keys. Only shortcuts defined in IPython (and not default prompt-toolkit shortcuts) can be modified or disabled. The full list of shortcuts, command identifiers and filters is available under :ref:`terminal-shortcuts-list`. Here is an example: .. code:: c.TerminalInteractiveShell.shortcuts = [ {{ "new_keys": ["c-q"], "command": "prompt_toolkit:named_commands.capitalize_word", "create": True, }}, {{ "new_keys": ["c-j"], "command": "prompt_toolkit:named_commands.beginning_of_line", "create": True, }}, ] z cg|]}d|d S)z - ``z``rNrZks rPr\z#TerminalInteractiveShell.rs &R&R&R!~~~~&R&R&RrO)filters)traitr shortcutscb|jr'||j|j_dSdS)Nuser_shortcuts)r_merge_shortcutsr key_bindingsrs rP_shortcuts_changedz+TerminalInteractiveShell._shortcuts_changedvs< ; X'+'<'z=TerminalInteractiveShell._merge_shortcuts..s6    go . .   rOc.i|]}t||SrN)rB)rZrs rPr0z=TerminalInteractiveShell._merge_shortcuts..s2   "'**G   rOrz - z< is not a known shortcut command. Allowed commands are: - rrcg|]@} |jkr1d|jDkrt|jk>|AS)Ncg|]}|SrNrNr"s rPr\zHTerminalInteractiveShell._merge_shortcuts...s-F-F-FAa-F-F-FrO)filterkeysrBr)rZr/ command_id old_filterold_keyss rPr\z=TerminalInteractiveShell._merge_shortcuts..sn'7>Z+G+G!)-F-F-F-F-F(-R-R)'/::jHH  IHHrOrrrFz"Cannot add a shortcut without keysc*i|]}|v||SrNrN)rZkeyshortcuts rPr0z=TerminalInteractiveShell._merge_shortcuts..s0!!!h#&rO)rr4rzNo shortcuts matching z found in r5zMultiple shortcuts matching z1 found, please add keys/filter to select one of: )r5r4always)skip)rAr?updater@rrgetrFlenr4rr5rrCrD)rr)r+allowed_commandsshortcuts_to_skipshortcuts_to_addmatchingrrr creating_newmodifying_existing specificationmatchedr/r6r7r8r;s @@@@rPr*z)TerminalInteractiveShell._merge_shortcuts{s/55   '      :      &O O H!),J!111#*<<0@#A#A  !FF3CFF ||L$77H"X--#8N#;<<<  +H ||J55H!lD99J&z2G#<<%88L%1!1"$2   GB !EFFF! !!!!4!!! x==A%%$XXX,XX]]Q&&$P}PPEMPP #1+$^  --!(("%)2~~ ''"%1 *5/z:::$.#9!+ %7%A%A   "0;LMMM ' / /G  g . . . .rOz9Display the current vi mode (when using vi editing mode).ra-The format for line numbering. Will be passed the current line number ``line`` (int, 1 based), and the relative line number ``rel_line``. For example to display both, you can use the following template string: ``c.TerminalInteractiveShell.prompt_line_number_format = '{line: 4d}/{rel_line:+03d} | '`` This will display the current line number, with a leading space and a width of at least 4 characters, as well as the relative line number, 0-padded and always with a + or - sign. Note that when using Emacs mode, the prompt of the first line may not update. term_titlec|jrLtrEtdt|jt dStddS)NT)cwdF)rI_is_ttyr rterm_title_formatformatrrs rPinit_term_titlez(TerminalInteractiveShell.init_term_titlesc ? )w ) !$ ' ' ' 4188Z\\8JJ K K K K K !% ( ( ( ( (rOcF|jrtrtdSdSdSr)rIrLrrs rPrz+TerminalInteractiveShell.restore_term_titles9 ? !w !   ! ! ! !rOctt||jjd}d|vr d|dvs-t |j_d|vr d|dvst|_dSdSdS)NrDisplayFormatter active_typesrmime_renderers) rrinit_display_formatterdisplay_formatter _trait_valuesr rSr rT)rrrs rPrUz/TerminalInteractiveShell.init_display_formatters &--DDFFF'5h? & ( (&);"<<<2XD " /*f44$/I(JJJ&E###=< KJrOc\jrfd}|_dSj}t }t fd}ttj }d_ tdj |||tj|djjjdd _t+j t,r!j jdSdS) Nc2ddjD}t|g}ddjD}d|ddkrT|t|d|ddkTd|S)Nrc3&K|] }|dV dSr5NrNrZrs rP zSTerminalInteractiveShell.init_prompt_toolkit_cli..prompt..s&%T%Tqad%T%T%T%T%T%TrOc3&K|] }|dV dSr[rNr\s rPr]zSTerminalInteractiveShell.init_prompt_toolkit_cli..prompt..s7..AaD......rOr}r incomplete)rrin_prompt_tokensr continuation_prompt_tokenscheck_completer) prompt_textlinesprompt_continuationrs rPpromptz@TerminalInteractiveShell.init_prompt_toolkit_cli..prompts gg%T%TDL4Q4Q4S4S%T%T%TTT {++,&(gg.."&,"I"I"K"K...''#))$))E*:*:;;A>,NNLL':!;!;<<<))$))E*:*:;;A>,NNyy'''rOr(cjSr)rrsrPrzBTerminalInteractiveShell.init_prompt_toolkit_cli..)s T[rOF)rz.py) rrr+history completerenable_history_searchstyleinclude_default_pygments_style mouse_supportenable_open_in_editor color_depthtempfile_suffixrN)rprompt_for_coder*r&rrr/rr"rr_use_asyncio_inputhookr,rr=rjrmextra_open_editor_shortcutsro_extra_prompt_optionsrrrGconnect)rrfr+rhptk_srs` rPinit_prompt_toolkit_cliz0TerminalInteractiveShell.init_prompt_toolkit_clis^    ( ( ( ( ($*D F,,DN,KK $D)) 000011{D,=,C,C,E,EFF &+## *%%(t444"&"<+0,"&"B(!  ((**    d')H I I 3   % %dk 2 2 2 2 2 3 3rOcf|dksJ|j}tj|d}| J||dkr i}t}n3i|j|j}|jt|j}nt}tt|t|g}|S)z Small wrapper that make an IPython compatible style from a style name We need that to add style for prompt ... etc. rNnocolor) rrr r?rJ extra_stylehighlighting_style_overridesbaser3r0r1r2)r name_or_clsrthemestyle_overrides style_clsrks rPrz5TerminalInteractiveShell._make_style_from_name_or_cls@s h&&&&""$$--  &   Y   O IIX!2Xd6WXOz%-ej99 $ ' 22(99    rOc`tjtjtjd|jS)N)rrr)r- MULTI_COLUMNCOLUMN READLINE_LIKEdisplay_completionsrs rPpt_complete_stylez*TerminalInteractiveShell.pt_complete_style_s2)5#*)7    " $ $rOc,|jr tjndSr) true_colorr* TRUE_COLORrs rProz$TerminalInteractiveShell.color_depthgs)-B %%dCrOrQr^rScVtt|jj|||S)N)rRrS)r&rjrra)rrQr^rSs rP_ptk_prompt_contz)TerminalInteractiveShell._ptk_prompt_contks7 7 7"%       rOcfd}jdkrjdkr |}dtj|jdjt tdtttztfdz t ttttztfd z gd }|S) z\ Return the current layout option for the current Terminal InteractiveShell cPtjSr)r&rr`rsrP get_messagezCTerminalInteractiveShell._extra_prompt_options..get_messageys!$,"?"?"A"ABB BrOrrFTz[](){})charscjSr)highlight_matching_bracketsrsrPrz@TerminalInteractiveShell._extra_prompt_options..s (HrO) processorr4c8tjtSr)rrrGrsrPrz@TerminalInteractiveShell._extra_prompt_options..s  -;!!rO)complete_in_threadlexerreserve_space_for_menumessagere multilinecomplete_styleinput_processors) rprompt_line_number_formatr>space_for_menurrr(r)r#r!r%r$rH)rroptionss` rPrtz.TerminalInteractiveShell._extra_prompt_optionsus< C C C C C   ' 'D,Jb,P,P&+--K#(#%%&*&9"#'#8"4%?hOOO#N33xxi  H H H HIIJ%;==#N33xxi    !  @rOc ||jr|j}d|_nd}td5|jrHt}||jjdd|i|}n,|jjd||j d|}dddn #1swxYwY|S)NrT)rawr)r inputhookrN) rl_next_inputr+rrrrun_until_completer prompt_asyncrtrf _inputhook)rr asyncio_looptexts rPrqz(TerminalInteractiveShell.prompt_for_codes8   (G!%D  Gd # # #  *  011 #66,DK, '+/+E+E+G+G *t{)#"o0022               $ sAcliwin32r)sysplatformcoloramainit)rrs rPinit_ioz TerminalInteractiveShell.init_ios/ </ / / F rOctt||tdSr)rr init_magicsregister_magicsr8)rrs rPrz$TerminalInteractiveShell.init_magicss: &--99;;; ^,,,,,rOctt|tjdkr dD]}|j||dSdS)Nrm)clearmorelessman)rr init_aliasrprt alias_managersoft_define_alias)rcmdrs rPrz#TerminalInteractiveShell.init_aliassn &--88::: 7g  7 ? ?"44S#>>>>   ? ?rOrctj|i|||j||d|_||jdS)NT) rrrrrwrO keep_runningrr)rargskwargsrs rPrz!TerminalInteractiveShell.__init__s$)&))) !!$"?@@@ $$&&&   D./////rOcd|_dSr)rrs rPask_exitz!TerminalInteractiveShell.ask_exits!rOcBd|_|jrt|jd |}|r||dnB#t $r5|jr|dddr|YnwxYw|jdSdS)NTr)end) store_historyz#Do you really want to exit ([y]/n)?yn) rprint separate_inrqrun_cellEOFError confirm_exit ask_yes_nor)rcodes rPinteractz!TerminalInteractiveShell.interacts  < $" + + + + <++--<MM$dM;;; $ $ $)$??+PQTUXYY$MMOOO $  < < < < Nwebaggasyncio) core.pylabtoolsrrrrr9loginforwarningrr)rrrnewev newinhooks rP enable_guiz#TerminalInteractiveShell.enable_gui$s  4 F F F F F F..s33C   % %#/d{{< f3fffi F ? "s{ / 0 0 0 F ? &3?:3?? E9)++ dD4Iddd H  F4K`FFF    F ? &3;6: :D !DO  ;C///5PQT5U5U 2D !4??6: :D !DO&)Y&6###rOc8|jsdS|j}|jr?t t |d|jjjt|dSd d|D}t||ddS)z>Overridden from the parent class to use fancy rewriting promptNr)rrkc3 K|] \}}|V dSrrN)rZtr s rPr]z>TerminalInteractiveShell.auto_rewrite_input..ds&2241aQ222222rO)sep) show_rewritten_inputrrewrite_prompt_tokensrr.r&apprkrr)rrtokensrfs rPauto_rewrite_inputz+TerminalInteractiveShell.auto_rewrite_inputYs(  F3355 ; ' !7!7R'+{'< > > > > #JJJJJWW22622222F  & & & & & &rOc|r"|j|_t||_dS|jr|j|_d|_dSdS)z+Switch prompts to classic for %doctest_modeN)r_prompts_beforer;)rr|s rPswitch_doctest_modez,TerminalInteractiveShell.switch_doctest_modehsT  (#'$$X$DDXD c      111fB----- ? ? ? ? ?000000"""M<<< 4J%%%'+hsm***/7/7hsm/7t/7/7/7/7f (F ' ' 'O(((((((rOr__main__)rrprrawarningsrtypingrrrIPython.core.async_helpersrIPython.core.interactiveshellrrIPython.core.kittyr r IPython.utils.py3compatr IPython.utils.PyColorizer IPython.utils.terminalr rrIPython.utils.processr traitletsrrrrrrrrrrrrrrtraitlets.utils.importstringrprompt_toolkit.auto_suggestr prompt_toolkit.enumsr!r"prompt_toolkit.filtersr#r$r%prompt_toolkit.formatted_textr&prompt_toolkit.historyr' prompt_toolkit.layout.processorsr(r)prompt_toolkit.outputr*prompt_toolkit.patch_stdoutr+prompt_toolkit.shortcutsr,r-r.prompt_toolkit.stylesr/r0prompt_toolkit.styles.pygmentsr1r2pygments.stylesr3pygments.styler4debuggerr6r7magicsr8 pt_inputhooksr9rr:r;r<ptutilsr=r>r&r?r@rArBrCrDshortcuts.filtersrErFshortcuts.auto_suggestrGrHrJrrjru_namer_streamrryrLrrqrrrrrregisterrKinstancerrNrOrPr+s55 ////////777777OOOOOOOO*)))))000000\\\\\\\\\\,,,,,,"544444?>>>>><<<<<<<<>>>>>>>>>>888888******dddddddd,,,,,,444444WWWWWWWWWW<<<<<<<<\\\\\\\\------ &&&&&&&&""""""666666CCCCCCCCCC77777777FEEEEEEE      u   ""#&"47""""6   &+  Egc5!!G gggx88 @P@P G E    G/"*<Ng+    " " " # # # # # # # # J`(`(`(`(`(/`(`(`(H5666 z%%''0022222s$E..E98E9