Format: application/x-python-code
1 o
2
3 ��hx
4 � @ sT d Z ddlmZ ddlmZ dd� Zdd� Zdd e� fd
5 ededee fd
6 d�Z
7 dS )z�Decorators that don't go anywhere else.
8
9 This module contains misc. decorators that don't really go with another module
10 in :mod:`IPython.utils`. Before putting something here please see if it should
11 go into another topical module in :mod:`IPython.utils`.
12 � )�Sequence)�GENERATING_DOCUMENTATIONc s. t � d�r� S � �fdd��d�_� j�_�S )a% Wrap a function to detect and flag when it gets called.
13
14 This is a decorator which takes a function and wraps it in a function with
15 a 'called' attribute. wrapper.called is initialized to False.
16
17 The wrapper.called attribute is set to False right before each call to the
18 wrapped function, so if the call fails it remains False. After the call
19 completes, wrapper.called is set to True and the output is returned.
20
21 Testing for truth in wrapper.called allows you to determine if a call to
22 func() was attempted and succeeded.�calledc s d�_ � | i |��}d�_ |S )NFT)r )�args�kw�out��func�wrapper� �Nc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/utils/decorators.pyr
23 - s zflag_calls.<locals>.wrapperF)�hasattrr �__doc__�r r r r �
24 flag_calls s
25 r c C s | S )z�Mark a function or class as undocumented.
26
27 This is found by inspecting the AST, so for now it must be used directly
28 as @undoc, not as e.g. @decorators.undoc
29 r r r r r �undoc8 s r TF�show_inheritance�show_inherited_members�exclude_inherited_fromc s � ��fdd�}|S )zSet sphinx optionsc s t s| S t��� d�| _| S )N)r r r )r �dictZ_sphinx_optionsr �r r r r r r
30 H s �zsphinx_options.<locals>.wrapperr )r r r r
31 r r r �sphinx_optionsA s r N)r �typingr ZIPython.utils.docsr r r �tuple�bool�strr r r r r �<module> s
32 ����