Format: application/x-python-code
1 o
2
3 ��h5s � @ sf d Z ddlZddlmZmZ ddlZddlZddlZddlm Z m
4 Z
5 mZmZ ddl
6 Z
7 ddlmZ e�d�Zdd� Zd d
8 � ZG dd� d�Zee�d
9 �e�d�d�Zee�dej��Zdd� Zdee fdd�Zdefdd�Zde
10 eef defdd�ZG dd� d�ZG dd � d e�ZG d!d"� d"e�Zd#Z d$Z!d%Z"d&Z#d'Z$d(Z%d)Z&d*Z'd+Z(h d,�Z)d$d&hZ*d-d.� Z+d/d0� Z,d1d2� Z-d3d4� Z.d5d6� Z/d7d8� Z0d9d:� Z1e d;j2e!d<j2e"e,e#e-e$e.e&e/e'e0e(e1iZ3G d=d>� d>e�Z4e�d?ej�Z5G d@dA� dAe�Z6dBe e7 fdCdD�Z8dEe ej9 fdFdG�Z:dHe7fdIdJ�Z;dKZ<G dLdM� dM�Z=dNdO� Z>G dPdQ� dQe�Z?G dRdS� dSe�Z@ejAZBe@eBdT�ZCdS )Ua5 Input transformer machinery to support IPython special syntax.
11
12 This includes the machinery to recognise and transform ``%magic`` commands,
13 ``!system`` commands, ``help?`` querying, prompt stripping, and so forth.
14
15 Added: IPython 7.0. Replaces inputsplitter and inputtransformer which were
16 deprecated in 7.0.
17 � N)�CommandCompiler�Compile)�List�Tuple�Optional�Any)� tokenutilz^[ \t]+c C s: | s| S t | �D ]\}}|r|�� s| |d� S q| S )zyRemove leading empty lines
18
19 If the leading lines are empty or contain only whitespace, they will be
20 removed.
21 N)� enumerate�isspace)�lines�i�line� r �Tc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/core/inputtransformer2.py�leading_empty_lines s �r c sD | s| S t �| d �}|s| S |�d��t��� � �fdd�| D �S )z�Remove leading indentation.
22
23 If the first line starts with a spaces or tabs, the same whitespace will be
24 removed from each following line in the cell.
25 r c s&