/ lib / IPython / lib / pretty.pyc
pretty.pyc
  1  o

  2  .��c�x�	@sdZddlmZddlZddlZddlZddlZddlZddlm	Z	ddl
  3  mZddlm
Z
ddlmZddlmZdd	lmZgd
  4  �ZdZee�d��Zdod
d�ZeGdd�de
��Zdd�Zdddefdd�Zdddefdd�ZGdd�de�ZGdd�de�Z dd�Z!Gd d!�d!e �Z"Gd"d#�d#e�Z#Gd$d%�d%e#�Z$Gd&d'�d'e#�Z%Gd(d)�d)e#�Z&Gd*d+�d+e�Z'Gd,d-�d-�Z(Gd.d/�d/�Z)Gd0d1�d1�Z*d2d3�Z+d4d5�Z,d6d7�Z-d8d9�Z.d:d;�Z/Gd<d=�d=�Z0d>d?�Z1d@dA�Z2dBdC�Z3dDdE�Z4dFdG�Z5dHdI�Z6ze7Z8Wne9�ye:Z8Ynwie;e4�e<e4�e=e4�e>e,dJdK��e?e,dLdM��e@e.dNdO��eAe-dNdO��eBe-dPdQ��eCe/�ee1�ee3�ejDe5�ejEe5�ejFe4�ejGe2�eje4�ejHe4�e8e6i�ZIeejJ�ZKeKe@u�rne.dRdO�eIeK<zeI�LejMe.dSdQ��e3eIejN<e4eIejO<WneP�y�e.dTdQ�eIejQ<e4eIeR<Ynwe4eIeS<e4eIeT<iZUdUdV�ZVdWdX�ZWe@�XeYeZddYde[e\g�e4�Z]dZd[�Z^d\d]�Z_d^d_�Z`d`da�Zadbdc�ZbeWdddee^�eWdddfe_�eWdddge`�eWdddhea�eWdddieb�ecdjk�r	ddkldmeZeGdldm�dme�Zfeef�dYdn�dSdS)pa�
  5  
  6  Python advanced pretty printer.  This pretty printer is intended to
  7  replace the old `pprint` python module which does not allow developers
  8  to provide their own pretty print callbacks.
  9  
 10  This module is based on ruby's `prettyprint.rb` library by `Tanaka Akira`.
 11  
 12  
 13  Example Usage
 14  -------------
 15  
 16  To directly print the representation of an object use `pprint`::
 17  
 18      from pretty import pprint
 19      pprint(complex_object)
 20  
 21  To get a string of the output use `pretty`::
 22  
 23      from pretty import pretty
 24      string = pretty(complex_object)
 25  
 26  
 27  Extending
 28  ---------
 29  
 30  The pretty library allows developers to add pretty printing rules for their
 31  own objects.  This process is straightforward.  All you have to do is to
 32  add a `_repr_pretty_` method to your object and call the methods on the
 33  pretty printer passed::
 34  
 35      class MyObject(object):
 36  
 37          def _repr_pretty_(self, p, cycle):
 38              ...
 39  
 40  Here's an example for a class with a simple constructor::
 41  
 42      class MySimpleObject:
 43  
 44          def __init__(self, a, b, *, c=None):
 45              self.a = a
 46              self.b = b
 47              self.c = c
 48  
 49          def _repr_pretty_(self, p, cycle):
 50              ctor = CallExpression.factory(self.__class__.__name__)
 51              if self.c is None:
 52                  p.pretty(ctor(a, b))
 53              else:
 54                  p.pretty(ctor(a, b, c=c))
 55  
 56  Here is an example implementation of a `_repr_pretty_` method for a list
 57  subclass::
 58  
 59      class MyList(list):
 60  
 61          def _repr_pretty_(self, p, cycle):
 62              if cycle:
 63                  p.text('MyList(...)')
 64              else:
 65                  with p.group(8, 'MyList([', '])'):
 66                      for idx, item in enumerate(self):
 67                          if idx:
 68                              p.text(',')
 69                              p.breakable()
 70                          p.pretty(item)
 71  
 72  The `cycle` parameter is `True` if pretty detected a cycle.  You *have* to
 73  react to that or the result is an infinite loop.  `p.text()` just adds
 74  non breaking text to the output, `p.breakable()` either adds a whitespace
 75  or breaks here.  If you pass it an argument it's used instead of the
 76  default space.  `p.pretty` prettyprints another object using the pretty print
 77  method.
 78  
 79  The first parameter to the `group` function specifies the extra indentation
 80  of the next line.  In this example the next item will either be on the same
 81  line (if the items are short enough) or aligned with the right edge of the
 82  opening bracket of `MyList`.
 83  
 84  If you just want to indent something you can use the group function
 85  without open / close parameters.  You can also use this code::
 86  
 87      with p.indent(2):
 88          ...
 89  
 90  Inheritance diagram:
 91  
 92  .. inheritance-diagram:: IPython.lib.pretty
 93     :parts: 3
 94  
 95  :copyright: 2007 by Armin Ronacher.
 96              Portions (c) 2009 by Robert Kern.
 97  :license: BSD License.
 98  �)�contextmanagerN)�deque)�	signature)�StringIO)�warn)�undoc)�PYPY)	�pretty�pprint�
PrettyPrinter�RepresentationPrinter�for_type�for_type_by_name�RawText�RawStringLiteral�CallExpressioni��cCs&zt|||�WSty|YSw)zzSafe version of getattr.
 99  
100      Same as getattr, but will return ``default`` on any Exception,
101      rather than raising.
102      )�getattr�	Exception)�obj�attr�default�r��C:\Users\Jacks.GUTTSPC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\IPython\lib\pretty.py�
_safe_getattrvs
103  �rcseZdZ�fdd�Z�ZS)�
104  CUnicodeIOcs$t�j|i|��tdtdd�dS)NzKCUnicodeIO is deprecated since IPython 6.0. Please use io.StringIO instead.�)�
105  stacklevel)�super�__init__r�DeprecationWarning)�self�args�kwargs��	__class__rrr�s
106  �zCUnicodeIO.__init__)�__name__�
107  __module__�__qualname__r�
__classcell__rrr$rr�srcCsPt|�}zt|�WSty'z	t|td�WYSty&|YYSww)z�
108      Sort the given items for pretty printing. Since some predictable
109      sorting is better than no sorting at all, we sort on the string
110      representation if normal sorting fails.
111      )�key)�list�sortedr�str)�itemsrrr�_sorted_for_pprint�s
112  ��r/F�O�
113  cCs2t�}t|||||d�}|�|�|��|��S)z3
114      Pretty print the object's representation.
115      ��max_seq_length)rrr	�flush�getvalue)r�verbose�	max_width�newliner3�stream�printerrrrr	�s
116  
117  r	cCs@ttj||||d�}|�|�|��tj�|�tj��dS)z,
118      Like `pretty` but print to stdout.
119      r2N)r�sys�stdoutr	r4�write)rr6r7r8r3r:rrrr
120  �s
121  
122  r
123  c@s&eZdZedd��Zeddd��ZdS)	�_PrettyPrinterBasec	cs<�|j|7_z
dVW|j|8_dS|j|8_w)z/with statement support for indenting/dedenting.N)�indentation)r!�indentrrrr@�s
124  �"z_PrettyPrinterBase.indentrrc
125  cs6�|�||�zdVW|�||�dS|�||�w)z8like begin_group / end_group but for the with statement.N)�begin_group�	end_group)r!r@�open�closerrr�group�s
126  �z_PrettyPrinterBase.groupN)rrr)r&r'r(rr@rErrrrr>�s
127  
128  r>c@sneZdZdZddefdd�Zdd�Zdd	�Zd
129  d�Zdd
d�Z	dd�Z
130  ddd�Zdd�Zddd�Z
dd�ZdS)ra
131      Baseclass for the `RepresentationPrinter` prettyprinter that is used to
132      generate pretty reprs of objects.  Contrary to the `RepresentationPrinter`
133      this printer knows nothing about the default pprinters or the `_repr_pretty_`
134      callback method.
135      r0r1cCsP||_||_||_||_d|_d|_t�|_td�}|g|_	t
136  |�|_d|_dS�Nr)
�outputr7r8r3�output_width�buffer_widthr�buffer�Group�group_stack�
137  GroupQueue�group_queuer?)r!rGr7r8r3Z
138  root_grouprrrr�s
139  
140  zPrettyPrinter.__init__cCs�|jr|j��}|�|j|j�|_|j|j8_|js|jrJt|jdt�rN|j��}|�|j|j�|_|j|j8_|jrLt|jdt�s'dSdSdSdSrF)	�
141  breakablesrJ�popleftrGrHrI�width�
142  isinstance�Text)r!rE�xrrr�_break_one_group�s
143  �
144  &�zPrettyPrinter._break_one_groupcCsH|j|j|jkr"|j��}|sdS|�|�|j|j|jks	dSdS�N)r7rHrIrN�deqrU�r!rErrr�_break_outer_groups�s
145  
146  �z!PrettyPrinter._break_outer_groupscCsxt|�}|jr-|jd}t|t�st�}|j�|�|�||�|j|7_|��dS|j�	|�|j
147  |7_
148  dS)zAdd literal text to the output.�����N)�lenrJrRrS�append�addrIrYrGr=rH)r!rrQ�textrrrr^�s
149  
150  zPrettyPrinter.text� cCs�t|�}|jd}|jr)|��|j�|j�|j�d|j�|j|_d|_	dS|j
151  �t|||��|j	|7_	|�
�dS)z�
152          Add a breakable separator to the output.  This does not mean that it
153          will automatically break here.  If no breaking on this position takes
154          place the `sep` is inserted which default to one space.
155          rZr_rN)r[rL�
156  want_breakr4rGr=r8r?rHrIrJr\�	BreakablerY)r!�seprQrErrr�	breakable�s
157  
158  zPrettyPrinter.breakablecCsR|j��}|r|�|�|��|j�|j�|j�d|j�|j|_d|_	dS)z_
159          Explicitly insert a newline into the output, maintaining correct indentation.
160          r_rN)
161  rNrWrUr4rGr=r8r?rHrIrXrrr�break_
162  s
163  
164  
165  zPrettyPrinter.break_rrcCsL|r|�|�t|jdjd�}|j�|�|j�|�|j|7_dS)z�
166          Begin a group.
167          The first parameter specifies the indentation for the next line (usually
168          the width of the opening text), the second the opening text.  All
169          parameters are optional.
170          rZ�N)r^rKrL�depthr\rN�enqr?)r!r@rCrErrrrAs
171  zPrettyPrinter.begin_groupccsT�t|�D]"\}}|jr"||jkr"|�d�|��|�d�dS||fVqdS)z>like enumerate, but with an upper limit on the number of items�,�...N)�	enumerater3r^rc)r!�seq�idxrTrrr�
172  _enumerate&s�
173  
174  �zPrettyPrinter._enumeratecCs@|j|8_|j��}|js|j�|�|r|�|�dSdS)z0End a group. See `begin_group` for more details.N)r?rL�poprOrN�remover^)r!�dedentrDrErrrrB0s
175  �zPrettyPrinter.end_groupcCs:|jD]}|j|�|j|j�7_q|j��d|_dS)z&Flush data that is left in the buffer.rN)rJrHrG�clearrI)r!�datarrrr49s
176  
177  
178  zPrettyPrinter.flushN)r_)rr)r&r'r(�__doc__�MAX_SEQ_LENGTHrrUrYr^rcrdrArmrBr4rrrrr�s
179  
180  
181  
182  
183  	rcCsXt|d�s'zt|j|tfi�}Wn
ty|g}Y|Sw|jdd�}|S|j}|S)z| Get a reasonable method resolution order of a class and its superclasses
184      for both old-style and new-style classes.
185      �__mro__rerZ)�hasattr�typer&�object�	TypeErrorru)�	obj_class�mrorrr�_get_mroAs
186  ��r|c@s8eZdZdZddddddefdd�Zdd	�Zd
187  d�ZdS)ra
188      Special pretty printer that has a `pretty` method that calls the pretty
189      printer for a python object.
190  
191      This class stores processing data on `self` so you must *never* use
192      this class in a threaded environment.  Always lock it or reinstanciate
193      it.
194  
195      Instances also have a verbose flag callbacks can access to control their
196      output.  For example the default instance repr prints all attributes and
197      methods that are not prefixed by an underscore if the printer is in
198      verbose mode.
199      Fr0r1Nc		Csftj|||||d�||_g|_|durt��}||_|dur#t��}||_|dur.t	��}||_
200  dS)Nr2)rrr6�stack�_singleton_pprinters�copy�singleton_pprinters�_type_pprinters�type_pprinters�_deferred_type_pprinters�deferred_pprinters)	r!rGr6r7r8r�r�r�r3rrrrcs
201  zRepresentationPrinter.__init__c	Cs�t|�}||jv}|j�|�|��z�t|dd�pt|�}z|j|}Wnttfy0Ynw||||�W|�	�|j�
202  �St|�D]s}||jvra|j||||�W|�	�|j�
203  �S|�
|�}|dur|||||�W|�	�|j�
204  �Sd|jvr�|j}t|�r�||||�W|�	�|j�
205  �S|tur�t|j�d��r�t|||�W|�	�|j�
206  �SqEt|||�W|�	�|j�
207  �S|�	�|j�
208  �w)zPretty print the given object.r%N�
_repr_pretty_�__repr__)�idr}r\rArrwr�ry�KeyErrorrBrnr|r��_in_deferred_types�__dict__r��callablerx�get�_repr_pprint�_default_pprint)r!r�obj_id�cyclerzr:�cls�methrrrr	tsT
209  ��
210  
211  �
212  ������zRepresentationPrinter.prettycCsHt|dd�}t|dd�}||f}d}||jvr"|j�|�}||j|<|S)a
213          Check if the given class is specified in the deferred type registry.
214  
215          Returns the printer from the registry if it exists, and None if the
216          class is not in the registry. Successful matches will be moved to the
217          regular type registry for future use.
218          r'Nr&)rr�rnr�)r!r��mod�namer*r:rrrr��s
219  
220  z(RepresentationPrinter._in_deferred_types)r&r'r(rsrtrr	r�rrrrrTs
221  �-rc@�eZdZdd�ZdS)�	PrintablecCs|SrVr�r!r9rHrrrrG�szPrintable.outputN)r&r'r(rGrrrrr���r�c@s$eZdZdd�Zdd�Zdd�ZdS)rScCsg|_d|_dSrF)�objsrQ�r!rrrr�s
222  z
Text.__init__cCs |jD]}|�|�q||jSrV)r�r=rQ)r!r9rHrrrrrG�s
223  
224  zText.outputcCs|j�|�|j|7_dSrV)r�r\rQ)r!rrQrrrr]�szText.addN)r&r'r(rrGr]rrrrrS�srSc@�eZdZdd�Zdd�ZdS)racCs8||_||_||_|j|_|jd|_|jj�|�dS)NrZ)rrQr	r?rLrErOr\)r!rkrQr	rrrr�szBreakable.__init__cCsf|jj��|jjr|�|jj�|�d|j�|jS|jjs(|jj�	|j�|�|j
225  �||jS)Nr_)rErOrPr`r=r	r8r?rNrorrQr�rrrrG�s
226  zBreakable.outputN)r&r'r(rrGrrrrra�srac@r�)rKcCs||_t�|_d|_dS)NF)rfrrOr`)r!rfrrrr�s
227  zGroup.__init__N)r&r'r(rrrrrrK�r�rKc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
228  rMcGsg|_|D]}|�|�qdSrV)�queuerg)r!�groupsrErrrr�s�zGroupQueue.__init__cCsJ|j}|t|j�dkr|j�g�|t|j�dks|j|�|�dS)Nre)rfr[r�r\)r!rErfrrrrg�s
229  �zGroupQueue.enqcCs^|jD])}tt|��D]\}}|jr||=d|_|Sq|D]}d|_q!|dd�=qdS)NT)r�rj�reversedrOr`)r!r}rlrErrrrW�s
230  ��zGroupQueue.deqcCs.z|j|j�|�WdStyYdSwrV)r�rfro�
231  ValueErrorrXrrrros
232  �zGroupQueue.removeN)r&r'r(rrgrWrorrrrrM�s
233  rMc@� eZdZdZdd�Zdd�ZdS)rz� Object such that ``p.pretty(RawText(value))`` is the same as ``p.text(value)``.
234  
235      An example usage of this would be to show a list as binary numbers, using
236      ``p.pretty([RawText(bin(i)) for i in integers])``.
237      cC�
238  ||_dSrV��value�r!r�rrrr
�
239  zRawText.__init__cCs|�|j�dSrV)r^r�)r!�pr�rrrr�szRawText._repr_pretty_N�r&r'r(rsrr�rrrrrsrc@s,eZdZdZdd�Zedd��Zdd�ZdS)	rzY Object which emits a line-wrapped call expression in the form `__name(*args, **kwargs)` cOs|}||_||_||_dSrV)r�r"r#)Z_CallExpression__selfZ_CallExpression__namer"r#r!rrrrs
240  zCallExpression.__init__c���fdd�}|S)Ncs��g|�Ri|��SrVr)r"r#�r�r�rr�inner sz%CallExpression.factory.<locals>.innerr)r�r�r�rr�r�factoryszCallExpression.factoryc
241  s�d���fdd�}|jd}��t|�|d��E|jD]
242  }|���|�q|j��D](\}}|�|d}��t|�|��
��|�Wd�n1sNwYq+Wd�dS1s_wYdS)NFcs�r��d����d�dS)NrhT)r^rcr�r��startedrr�new_item)s
243  z.CallExpression._repr_pretty_.<locals>.new_item�(�)�=)r�rEr[r"r	r#r.)r!r�r�r��prefix�arg�arg_nameZ
244  arg_prefixrr�rr�$s 
245  
246  ���"�zCallExpression._repr_pretty_N)r&r'r(rsr�classmethodr�r�rrrrrs
247  rc@r�)rz/ Wrapper that shows a string with a `r` prefix cCr�rVr�r�rrrr>r�zRawStringLiteral.__init__cCsNt|j�}|dd�dvr|dd�}d}nd}||�dd�}|�|�dS)NreZuU�ur�rz\\�\)�reprr��replacer^)r!r�r��	base_reprr�rrrr�As
248  zRawStringLiteral._repr_pretty_Nr�rrrrr<src	Cs0t|dd�p	t|�}t|dd�tjurt|||�dS|�dd�|�|�|�dt|��|r7|�d�nY|j	r�d}t
249  |�D]O}|�d	�s�zt||�}Wn	t
yWYq@wt|tj�r_q@|sf|�d
250  �|��|�|�|�d�t|�d}|j|7_|�|�|j|8_d}q@|�dd
�dS)zw
251      The default print function.  Used if an object does not provide one and
252      it's none of the builtin objects.
253      r%Nr�re�<z at 0x%xz ...T�_rhr�F�>)rrwrxr�r�rAr	r^r�r6�dir�
254  startswithr�AttributeErrorrR�types�
255  MethodTypercr[r?rB)rr�r��klass�firstr*r��steprrrr�Ls@
256  
257  �
258  
259  
260  
261  �r�cr�)z|
262      Factory that returns a pprint function useful for sequences.  Used by
263      the default pprint for tuples and lists.
264      cs�|r|��d��St��}|�|��|�|�D]\}}|r)|�d�|��|�|�qt|�dkr?t|t�r?|�d�|�|��dS)Nrirhre)	r^r[rArmrcr	rR�tuplerB)rr�r�r�rlrT��end�startrrr�ws
265  
266  z$_seq_pprinter_factory.<locals>.innerr�r�r�r�rr�r�_seq_pprinter_factoryr�r�cr�)zP
267      Factory that returns a pprint function useful for sets and frozensets.
268      cs�|r|��d��St|�dkr|�t|�jd�dSt��}|�|��|jr1t|�|jks6t|�}n|}|�|�D]\}}|rL|�d�|��|�	|�q=|�
269  |��dS)Nrirz()rh)r^r[rwr&rAr3r/rmrcr	rB)rr�r�r�r.rlrTr�rrr��s
270  
271  z$_set_pprinter_factory.<locals>.innerrr�rr�r�_set_pprinter_factory�sr�cr�)zj
272      Factory that returns a pprint function used by the default pprint of
273      dicts and dict proxies.
274      cs�|r|�d�St��}|�|��|��}|�|�D] \}}|r)|�d�|��|�|�|�d�|�||�q|�|��dS)Nz{...}rhz: )r^r[rA�keysrmrcr	rB)rr�r�r�r�rlr*r�rrr��s
275  
276  
277  
278  z%_dict_pprinter_factory.<locals>.innerrr�rr�r�_dict_pprinter_factory�r�r�cCsj|�dd�|�|j�|�d�|��tr'|jj}|�||ur#dn|�n|�|j�|�dd�dS)zThe pprint for the super type.�z<super: rhNr�)	rAr	�
__thisclass__r^rcrr��__self__rB)rr�r�Zdselfrrr�
_super_pprint�s
279  r�c@r�)�_ReFlagscCr�rVr�r�rrrr�r�z_ReFlags.__init__cCsBd}dD]}|jtt|�@r|r|�d�|�d|�d}qdS)NF)�TEMPLATE�
280  IGNORECASE�LOCALE�	MULTILINE�DOTALL�UNICODE�VERBOSE�DEBUG�|zre.T)r�r�rer^)r!r�r�Zdone_one�flagrrrr��s
281  ��z_ReFlags._repr_pretty_N)r&r'r(rr�rrrrr��sr�cCsHt�d�}|jr|�|t|j�t|j���dS|�|t|j���dS)z4The pprint function for regular expression patterns.z
282  re.compileN)rr��flagsr	r�patternr�)rr�r��
283  re_compilerrr�_re_pattern_pprint�s
284   r�cCs>t�d�}|r|�|td���dS|�|di|j���dS)z.The pprint function for types.SimpleNamespace.�	namespaceriNr)rr�r	rr�)rr�r�r�rrr�_types_simplenamespace_pprint�s
285  r�cCs�dd�tt|��D�dd�tgkrt|||�dSt|dd�}z|j}t|t�s-td��WntyA|j}t|t�s?d}Ynw|dvrM|�	|�dS|�	|d	|�dS)
286  z!The pprint for classes and types.cSsg|]
287  }dt|�vr|�qS)r�)�vars)�.0�mrrr�
288  <listcomp>�sz _type_pprint.<locals>.<listcomp>Nrer'zTry __name__z<unknown type>)N�__builtin__�builtins�
289  exceptions�.)
290  r|rwr�rr(rRr-rr&r^)rr�r�r�r�rrr�_type_pprint�s$$
291  �
292  ��r�cCsft|�}|��}|���t|�D]\}}|r|��|�|�qWd�dS1s,wYdS)z9A pprint that just redirects to the normal repr function.N)r��
293  splitlinesrErjrdr^)rr�r�rG�linesrlZoutput_linerrrr�s
294  �"�r�cCsjt|d|j�}|j}|r|dvr|d|}z
295  |tt|��}Wnty+|}Ynw|�d|�dS)z4Base pprint for all functions and builtin functions.r()r�r�r�r�z
<function %s>N)rr&r'r-rr�r^)rr�r�r�r�Zfunc_defrrr�_function_pprints�r�cCsPt|jd|jj�}|jjdvrd|jj|f}|�t|gt|dd��R��dS)zBase pprint for all exceptions.r()r�r�z%s.%sr"rN)rr%r&r'r	r)rr�r�r�rrr�_exception_pprint s"r�r�r��[�]�{�}zfrozenset({z})zenviron{zdict_proxy({zmappingproxy({cCs t�|d�}|dur|t|<|S)z0
296      Add a pretty printer for a given type.
297      N)r�r�)�typ�func�oldfuncrrrr
_sr
cCs(||f}t�|d�}|dur|t|<|S)z|
298      Add a pretty printer for a type specified by the module and name of a type
299      rather than the type object itself.
300      N)r�r�)�type_module�	type_namer�r*r�rrrris
301  rTcCsBt�|jj�}|r|�|td���dS|�||jt|���dS�Nri)rr�r%r&r	r�default_factory�dict�rr�r�Zcls_ctorrrr�_defaultdict_pprint{srcCsZt�|jj�}|r|�|td���dSt|�r%|�|t|�����dS|�|��dSr�)	rr�r%r&r	rr[r+r.rrrr�_ordereddict_pprint�srcCsdt�|jj�}|r|�|td���dS|jdur'|�|t|�|jd��dS|�|t|���dS)Nri)�maxlen)rr�r%r&r	rrr+rrrr�
_deque_pprint�s
302  rcCsVt�|jj�}|r|�|td���dSt|�r#|�|t|���dS|�|��dSr�)rr�r%r&r	rr[r�rrrr�_counter_pprint�srcCs<t�|jj�}|r|�|td���dS|�||j��dSr�)rr�r%r&r	rrrrrrr�_userlist_pprint�sr�collections�defaultdict�OrderedDictr�Counter�UserList�__main__)�	randrangec@r�)�FoocCs@d|_t�d�|_t�td�tdd��|_d|_	dd|g|_
303  dS)Nrez\s+��(gg�����@�blub�blah)�foor��compile�barr��fromkeys�ranger
rZheher+r�rrrr�s
304  zFoo.__init__cCstd�dS)Nr)�printr�rrr�get_foo�szFoo.get_fooN)r&r'r(rrrrrrr�sr)r6rV)grs�
305  contextlibr�datetime�osr�r;r�rr�inspectr�ior�warningsr�IPython.utils.decoratorsr�IPython.utils.py3compatr�__all__rtrwr�_re_pattern_typerrr/r	r
306  rxr>rr|rr�rSrarKrMrrrr�r�r�r�r�r�r�r�r�r�r�r��
BaseException�_exception_base�	NameErrorr�int�floatr-r�r+r��set�	frozensetr�FunctionType�BuiltinFunctionTyper��SimpleNamespace�	timedeltar��environ�	_env_type�
307  setdefaultZ
DictProxyType�	ClassTypeZ	SliceTyper��MappingProxyType�slicer�bytesr�r
rr�mapr��Ellipsis�NotImplementedr~rrrrrr&�randomr
rrrrr�<module>s_
308  
309  `
(&		

310  ����
311  �
312  �
313  �
314  �
315  �	�
316  ���
������
317  
318  �
319  ��
320  ��		
321  
322  �