Format: application/x-python-code
1 o
2
3 ��h2 � @ sf d Z ddlZddlmZ dd� Zdee fdd�Zdd
4 edefdd
5 �Zdde de
6 eef fdd�ZdS )z*
7 Utilities for working with stack frames.
8 � N)�Anyc s2 |� dd�}t�|d �j� t� fdd�| D ��S )ak Extract a set of variables by name from another frame.
9
10 Parameters
11 ----------
12 *names : str
13 One or more variable names which will be extracted from the caller's
14 frame.
15 **kw : integer, optional
16 How many frames in the stack to walk when looking for your variables.
17 The default is 0, which will use the frame where the call was made.
18
19 Examples
20 --------
21 ::
22
23 In [2]: def func(x):
24 ...: y = 1
25 ...: print(sorted(extract_vars('x','y').items()))
26 ...:
27
28 In [3]: func('hello')
29 [('x', 'hello'), ('y', 1)]
30 �depthr � c 3 � � | ] }|� | fV qd S �N� ��.0�k�ZcallerNSr �Ic:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/utils/frame.py� <genexpr>4 � � zextract_vars.<locals>.<genexpr>)�get�sys� _getframe�f_locals�dict)�names�kwr r r r �extract_vars s r r c s"