Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/IPython/core/__pycache__/inputsplitter.cpython-39.pyc
Ðазад
a o�hqq � @ s� d Z ddlmZ ede� ddlZddlZddlZddlZddlZddl Z ddlZddl mZmZm Z mZ ddlmZ ddlmZmZmZmZmZmZmZmZmZmZ ddlmZ dd lmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z' e�(d �)g d���Z*e�(d�Z+e�(d �Z,dd� Z-e j.Z/e j.d Z0G dd� d�Z1G dd� d�Z2dd� Z3e4d�dd�Z5dd� Z6e�(dej7�Z8e�(dej7�Z9dd� Z:d d!� Z;d"d#� Z<G d$d%� d%e=�Z>G d&d'� d'e>�Z?dS )(a6 DEPRECATED: Input handling and transformation machinery. This module was deprecated in IPython 7.0, in favour of inputtransformer2. The first class in this module, :class:`InputSplitter`, is designed to tell when input from a line-oriented frontend is complete and should be executed, and when the user should be prompted for another line of code instead. The name 'input splitter' is largely for historical reasons. A companion, :class:`IPythonInputSplitter`, provides the same functionality but with full support for the extended IPython syntax (magics, system calls, etc). The code to actually do these transformations is in :mod:`IPython.core.inputtransformer`. :class:`IPythonInputSplitter` feeds the raw code to the transformers in order and stores the results. For more details, see the class docstrings below. � )�warnzeIPython.core.inputsplitter is deprecated since IPython 7 in favor of `IPython.core.inputtransformer2`N)�List�Tuple�Union�Optional)�CodeType) �leading_indent�classic_prompt� ipy_prompt� cellmagic�assemble_logical_lines�help_end�escaped_commands�assign_from_magic�assign_from_system�assemble_python_lines)� tokenutil) � ESC_SHELL� ESC_SH_CAP�ESC_HELP� ESC_HELP2� ESC_MAGIC� ESC_MAGIC2� ESC_QUOTE� ESC_QUOTE2� ESC_PAREN� ESC_SEQUENCES�|)z^\s+raise(\s.*)?$z^\s+raise\([^\)]*\).*$z^\s+return(\s.*)?$z^\s+return\([^\)]*\).*$z^\s+pass\s*$z ^\s+break\s*$z^\s+continue\s*$z^([ \t\r\f\v]+)z^\s*\#c C s. t jddtd� t�| �}|r&|�� S dS dS )a Return the number of initial spaces in a string. Note that tabs are counted as a single space. For now, we do *not* support mixing of tabs and spaces in the user's input. Parameters ---------- s : string Returns ------- n : int z�`num_ini_spaces` is Pending Deprecation since IPython 8.17.It is considered fro removal in in future version. Please open an issue if you believe it should be kept.� )� stacklevel�categoryr N)�warningsr �PendingDeprecationWarning� ini_spaces_re�match�end)�sZ ini_spaces� r'