Files
intellecton/venv/lib/python3.12/site-packages/matplotlib/__pycache__/cbook.cpython-312.pyc
T

1105 lines
96 KiB
Plaintext
Raw Normal View History

Ë
†Rj”8ãó’dZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
m Z ddl Z ddl
Z
ddlZddlZddlZddlZddlZddlZ ddlmZddlZddlmZmZGdd«ZdZd „ZGd
d «Zd ZGd
d«Z Gdd«Z!Gdde"«Z#ejHdœdZ%dZ&dZ'dZ(dZ)d`dZ*dadZ+dZ,dbdZ-dZ.e,fdZ/Gd „d!«Z0dcd"„Z1ejddfd#„Z3Gd$„d%«Z4Gd&„d'«Z5d(„Z6d)„Z7d*„Z8dd+œd,„Z9ddd-„Z:d.d/d0d1d2œZ;e;jy«Dcic]\}}||Œ
c}}Z=d3„Z>d4„Z?d5„Z@d6„ZAd7„ZBded8„ZCd9„ZDd:„ZEd;„ZFd<„eDeDeEeFd=œZGd>„ZHd?„ZId@„ZJdA„ZKdfdB„ZLedC„«ZNeePedD«¬E«fdF„ZRdG„ZSdH„ZTdI„ZUdJ„ZVdK„ZWedL„«ZXGdM„dNe«Z[dO„Z\dP„Z]dQ„Z^dR„Z_dS„Z`dT„ZadU„ZbdV„ZcdW„ZdedfdX„«ZfdY„ZgdZ„Zhd[„Zid\„Zjd]„Zkd^„Zld_„Zmy#e$r
ddlmZYŒëwxYwcc}}w)gz‡
A collection of utility functions and classes. Originally, many
(but not all) were from the Python Cookbook -- hence the name cbook.
éN)ÚPath)ÚVisibleDeprecationWarning)Ú_apiÚ_c_internal_utilscó,eZdZdZdZed«ZdZy)Ú_ExceptionInfoa—
A class to carry exception information around.
This is used to store and later raise exceptions. It's an alternative to
directly storing Exception instances that circumvents traceback-related
issues: caching tracebacks can keep user's objects in local namespaces
alive indefinitely, which can lead to very surprising memory issues for
users and result in incorrect tracebacks.
có ||_||_y©Ú_clsÚ_args)ÚselfÚclsÚargss úS/home/antigravity/intellecton/venv/lib/python3.12/site-packages/matplotlib/cbook.pyÚ__init__z_ExceptionInfo.__init__.s؈Œ ؈
ócó:|t|«g|j¢­ŽSr
)Útyper)rÚexcs rÚfrom_exceptionz_ExceptionInfo.from_exception2sá”4˜“9Ð(˜sŸx™xÒ(rcó4|j|jŽSr
r ©rs rÚ to_exceptionz_ExceptionInfo.to_exception6s؈ty‰y˜$Ÿ*™*Ð%rN)Ú__name__Ú
__module__Ú __qualname__Ú__doc__rÚ classmethodrr©rrrr#s%ñòðñð&rrcóDtjjd«xsatjjd«xs@tjjd«xstjjd«}|r|jj «rytjjd«}|rF|j
dk(rdd lm}|j«ry
|j
d k(r|j«ry tjjd
«}|r|j«ry
tjjd«}|r€|jj|jjjh}tj«j«D]$}|sŒ|j |vry|j"}|rŒŒ&~tjjd«}|r|j%«ryt'j(«syy)a/
Return the interactive framework whose event loop is currently running, if
any, or "headless" if no event loop can be started, or None.
Returns
-------
Optional[str]
One of the following values: "qt", "gtk3", "gtk4", "wx", "tk",
"macosx", "headless", ``None``.
zPyQt6.QtWidgetszPySide6.QtWidgetszPyQt5.QtWidgetszPySide2.QtWidgetsÚqtzgi.repository.Gtkér)ÚGLibÚgtk4éÚgtk3ÚwxÚtkinterÚtkzmatplotlib.backends._macosxÚmacosxÚheadlessN)ÚsysÚmodulesÚgetÚ QApplicationÚinstanceÚ
MAJOR_VERSIONÚ
gi.repositoryr$Ú
main_depthÚ
main_levelÚGetAppÚmainloopÚ__code__ÚMiscÚ_current_framesÚvaluesÚf_codeÚf_backÚevent_loop_is_runningrÚdisplay_is_valid)Ú QtWidgetsÚGtkr$r(r)ÚcodesÚframer+s rÚ"_get_running_interactive_frameworkrD:ô Ð ;‰;?‰?Ð  ;‰;?‰?Ð  ;‰;?‰?Ð ñ Ü
+‰+/‰/Ð
.€CÙ
Ø × Ñ  Ò Ô ØØ × Ñ  Ò ! c§n¡nÔ&6ØÜ ˜Ó €BÙ ˆbi‰iŒkØÜk‰ko‰o˜iÓ(€GÙØ×!×*¨G¯L©L×,AÑ,A×,JÑ,JÐKˆÜ× %ˆØ—<< ØŸ óð
Ü
[‰[_‰_Ð
;€FÙ
&×Ü × Ø rcóHt«dvr|tj«y)N)r,N)rDÚ tracebackÚ print_exc)rs rÚ_exception_printerrHlsÜ+Ð/Aш ä×ÑÕrcó(eZdZdZdZdZdZdZy)Ú
_StrongRefzU
Wrapper similar to a weakref, but keeping a strong reference to the object.
có||_yr
©Ú_obj)rÚobjs rrz_StrongRef.__init__xs ؈ rcó|jSr
rLrs rÚ__call__z_StrongRef.__call__{s Øy‰yÐrcóXt|t«xr|j|jk(Sr
)Ú
isinstancerJrM)rÚothers rÚ__eq__z_StrongRef.__eq__~s!ܘӷ±¸e¿j¹jÑ1HÐHrcó,t|j«Sr
)ÚhashrMrs rÚ__hash__z_StrongRef.__hash__sÜD—IIÐrN)rrrrrrPrTrWr rrrJrJssñòòòIórrJcód tj||«S#t$rt|«cYSwxYw)zQ
Return a `WeakMethod` wrapping *func* if possible, else a `_StrongRef`.
)ÚweakrefÚ
WeakMethodÚ TypeErrorrJ)ÚfuncÚcallbacks rÚ_weak_or_strong_refr^s4ð Ü×! $¨Ó1øÜ ò ܘ$ÓÒð ús ˜/®/có.eZdZdZdZdZdZdZdZy)Ú _UnhashDicta
A minimal dict-like class that also supports unhashable keys, storing them
in a list of key-value pairs.
This class only implements the interface needed for `CallbackRegistry`, and
tries to minimize the overhead for the hashable case.
có>i|_g|_|D]
\}}|||<Œ yr
©Ú_dictÚ_pairs)rÚpairsÚvs rrz_UnhashDict.__init__˜s,؈Œ
؈Œ Øò ‰DˆAˆq؈DŠGñ rcóî ||j|<y#t$rYt|j«D]!\}\}}||k(sŒ||f|j|<Yy|jj ||f«YywxYwr
)rcr[Ú enumeraterdÚappend)rÚkeyÚvalueÚirfrgs rÚ __setitem__z_UnhashDict.__setitem__žsvð#ˆDJ‰JsŠOøÜò& t§{¡{Ó
1 6A˜“8Ø&)¨5 \D—KK ð
 ×"  
 1ús,A4¿A4ÁA4Á3A4có |j|S#t$rYnwxYw|jD]\}}||k(sŒ |cSt|«r
)rcr[rdÚKeyError)rrkrfrgs rÚ __getitem__z_UnhashDict.__getitem__©sVð Ø—::˜c‘?Ð "øÜò Ù ð úà—K‘Kò ‰DˆAˆqØC‹xØð ôs‹mÐs œcó
 ||jvr|jj|«S |r|dSt |«#t$r;t|j«D] \}\}}||k(sŒ|j|=|ccYSYŒUwxYw©Nr)rcÚpopr[rirdrp)rrkrrmrfrgs rrtz_UnhashDict.pop³sð Ød—j‘jÑ Ø—z‘z—~‘~ cÓ Ø˜‘7ˆNÜs‹mÐøôò Ü& t§{¡{Ó
‘6A˜“8ØŸ  A˜Ø”Hò
ð ús(>¾,BÁ+BÁ>BÂBc#óhK|jEd{|jD] \}}|Œ y7Œ­wr
rb©rrfrgs rÚ__iter__z_UnhashDict.__iter__Às4èø€Ø—:‘:×ÐØ—K‘Kò ‰DˆAˆqØ‹Gñ ð ús 202N) rrrrrrnrqrtrwr rrr`r`s ñòò ò órr`cóŽeZdZdZefddœdZdZdZdZdZ e
jd œd
Z d Z
d Zej dd
œd«Zy)ÚCallbackRegistryaö
Handle registering, processing, blocking, and disconnecting
for a set of signals and callbacks:
>>> def oneat(x):
... print('eat', x)
>>> def ondrink(x):
... print('drink', x)
>>> from matplotlib.cbook import CallbackRegistry
>>> callbacks = CallbackRegistry()
>>> id_eat = callbacks.connect('eat', oneat)
>>> id_drink = callbacks.connect('drink', ondrink)
>>> callbacks.process('drink', 123)
drink 123
>>> callbacks.process('eat', 456)
eat 456
>>> callbacks.process('be merry', 456) # nothing will be called
>>> callbacks.disconnect(id_eat)
>>> callbacks.process('eat', 456) # nothing will be called
>>> with callbacks.blocked(signal='drink'):
... callbacks.process('drink', 123) # nothing will be called
>>> callbacks.process('drink', 123)
drink 123
In practice, one should always disconnect all callbacks when they are
no longer needed to avoid dangling references (and thus memory leaks).
However, real code in Matplotlib rarely does so, and due to its design,
it is rather difficult to place this kind of code. To get around this,
and prevent this class of memory leaks, we instead store weak references
to bound methods only, so when the destination object needs to die, the
CallbackRegistry won't keep it alive.
Parameters
----------
exception_handler : callable, optional
If not None, *exception_handler* must be a function that takes an
`Exception` as single parameter. It gets called with any `Exception`
raised by the callbacks during `CallbackRegistry.process`, and may
either re-raise the exception or handle it in another manner.
The default handler prints the exception (with `traceback.print_exc`) if
an interactive event loop is running; it re-raises the exception if no
interactive event loop is running.
signals : list, optional
If not None, *signals* is a list of signals that this registry handles:
attempting to `process` or to `connect` to a signal not in the list
throws a `ValueError`. The default, None, does not restrict the
handled signals.
N)Úsignalscó¸|dn
t|«|_||_i|_t j
«|_tg«|_t«|_
yr
) ÚlistÚ_signalsÚexception_handlerÚ callbacksÚ itertoolsÚcountÚ_cid_genr`Ú
_func_cid_mapÚsetÚ
_pickled_cids)rr~rzs rrzCallbackRegistry.__init__sFØ ' ´T¸'³]ˆŒ
Ø!2ˆÔ؈ŒÜÓŒ
Ü›_ˆÔä ›UˆÕrcó4it|«¥|jj«Dcic]=\}}||j«Dcic]\}}||jvr||«Œc}}Œ?c}}}}dt |j
«dœ¥Scc}}wcc}}}}w)N)rr)ÚvarsrÚitemsr…Únextr)rÚcidÚproxys rÚ __getstate__zCallbackRegistry.__getstate__ sð

Ü4

ð '+§n¡n×&:Ñ&:Ó&<÷"˜a ð¸Q¿W¹W»Y÷<©z¨s°EØ!$¨×(:Ñ(:Ñ!:ð"¡5£7™ló˜TŸ]™]Ó

ð
ùó<ùõ>s¬B Á B Á(B Â B có
|jd«}t|«j|«|jj «Dcic]R\}}||j «Dcic]0\}}|t |t
j|j|««Œ2c}}ŒTc}}}}|_td|jj «D««|_
tj|«|_
ycc}}wcc}}}}w)Nrc3ó^K|]%\}}|j«D]
\}}||f|fŒŒ'y­wr
)rˆ)Ú.0rŠrrs rú <genexpr>z0CallbackRegistry.__setstate__.<locals>.<genexpr> sEèø€ò)LáÇÁÃò)Lá3=°3¸ðˆZ˜Ô ð)LØ ñ)Lùs+-)rtr‡Úupdaterrˆr^Ú functoolsÚpartialÚ
_remove_proxyr`r€rr)rÚstateÚ cid_countrŠrr\s rÚ __setstate__zCallbackRegistry.__setstate__Ø—II˜jÓ)ˆ Ü ˆT‹
×ј%Ô ðŸ×
Ø!"§¡£÷ðÔ¬y×/@Ñ/@À×ASÑASÐUVÓ/WÓ
Œô)LàŸ×)LóLˆÔô¨ Ó2ˆ
ùó
,ùõ0sÁ C=
Á'5C7ÂC=
Ã7C=
có€|j!tj|j|¬«t|t j
|j |««} |j||fS#t$rJt|j«x}|j||f<||jj|i«|<|cYSwxYw)z?Register *func* to be called when signal *signal* is generated.©Úsignal)
r}rÚ
check_in_listr^r”r•rrpr‰rrÚ
setdefault)rr\rs rÚconnectzCallbackRegistry.connect%à =‰=Ð × Ñ ˜tŸ}™}°VÕ # D¬)×*;Ñ*;¸D×<NÑ<NÐPVÓ*WÓXˆð Ø×% f¨e mÑ 4øÜò Ü6:¸4¿=¹=Ó6IÐ IˆC$×$ V¨U 3Ø9>ˆDN‰N× % f¨bÓ 1°#Ñ ŠJð úsÁA*Á*AB=Â<B=có`|j||«}|jj|«|S)z{
Like `.connect`, but the callback is kept when pickling/unpickling.
Currently internal-use only.
)r…Úadd)rr\s rÚ_connect_picklablez#CallbackRegistry._connect_picklable1s-ð l‰l˜6 4ÓØ ×Ñ×јsÔˆ
r)Ú_is_finalizingcó|«ry|jj||fd«}|,|j||=|jj |«nyt |j|«dk(r|j|=yyrs)rtrr…ÚdiscardÚlen)rrs rrzCallbackRegistry._remove_proxy=s{Ù Ô à Ø× Ñ ×$ f¨e _°dÓØ ˆ˜vÑ&  × Ñ × &  Ü ˆt~‰~˜ &¨!Ò ˜ ,rcój|jj|«|jD]\}}|j||f|k(sŒny|j|||k(sJ|j||=|jj ||f«t |j|«dk(r|j|=yy)z
Disconnect the callback registered with callback id *cid*.
No error is raised if such a callback does not exist.
Nr)r…rrt)rrs rÚ
disconnectzCallbackRegistry.disconnectJð
×Ñ×" !× ‰MˆF×! &¨% 0°CÓð ð
Ø~‰~˜fÑ% cÑ*¨eÒ N‰N˜ "   ×Ñ×Ñ ¨˜Ô ˆt~‰~˜ &¨!Ò ˜ ,rcó^|j!tj|j|¬«t|jj |i«j
««D]}|«}|Œ
||i|¤ŽŒy#t$r)}|j|j|«nYd}~ŒFd}~wwxYw)
Process signal *s*.
All of the functions registered to receive callbacks on *s* will be
called with ``*args`` and ``**kwargs``.
Nr) r}rrr|rr/r;Ú Exceptionr~)rrÚkwargsÚrefr\rs rÚprocesszCallbackRegistry.process\ð =‰=Ð × Ñ ˜tŸ}™}°QÕ ˜Ÿ×*¨1¨bÓ ˆCÙ“5ˆDØÑðÙ˜)  øôØ××.¨sÕô4ûðúsÁ/A:Á: B,ÂB'Â'B,rc#ó°K|j} |i|_n|Dcic]}||k7sŒ |||Œc}|_d||_ycc}w#||_wxYw­w)aV
Block callback signals from being processed.
A context manager to temporarily block/disable callback signals
from being processed by the registered listeners.
Parameters
----------
signal : str, optional
The callback signal to block. The default is to block all signals.
N)r)rÚorigrfs rÚblockedzCallbackRegistry.blockedrs^èø€ð~‰~ˆðˆ~à!#ð7;Ö!J°¸aÀ6»k ! T¨!¡W¡*Ò!JÛ à!ˆDNùò"Køð"ˆDNüs0
AA
ž
A©A± A
½AÁA
Á
AÁA)rrrrrHrr™r-Ú
is_finalizingrr­Ú
contextlibÚcontextmanagerr°r rrryryÆseñ6ðx*<ðô 
ò

òð>A×=NÑ=Nô 'ò$ð,×ÑØ $óñ"rrycóeZdZdZddZdZy)Ú silent_lista
A list with a short ``repr()``.
This is meant to be used for a homogeneous list of artists, so that they
don't cause long, meaningless output.
Instead of ::
[<matplotlib.lines.Line2D object at 0x7f5749fed3c8>,
<matplotlib.lines.Line2D object at 0x7f5749fed4e0>,
<matplotlib.lines.Line2D object at 0x7f5758016550>]
one will get ::
<a list of 3 Line2D objects>
If ``self.type`` is None, the type name is obtained from the first item in
the list (if any).
Ncó:||_||j|«yyr
)rÚextend)rrÚseqs rrzsilent_list.__init__¡s؈Œ Ø ˆ?Ø K‰K˜Õ ð rcó¼|jt|«dk7rB|j |jnt|d«j}dt|«d|dSy)Nrz <a list of ú z objects>z<an empty list>)rr)rÚtps rÚ__repr__zsilent_list.__repr__¦sTØ 9‰9Ð ¤C¨£I°¢NØ"Ÿi™iÐ3¼¸dÀ1¹g»×9OÑ9OˆBØ ¤ T£  ¨1¨R¨D° Ð $rr
)rrrrrr rrŒsñó(ó
%r)Ú warning_clscó€|}|D]6}|j|d«}|Œ||}Œtjd|d|«Œ8|S)"z"" keyword argument will be ignored)rtrÚ
warn_external)Ú local_varr«ÚkeysÚoutrkÚ kwarg_vals rÚ_local_over_kwdictrÅ®s\ð €CØòØ—J‘J˜s DÓ)ˆ Ø Ñ Øˆ{Øä×" Q s eÐ+MÐ#NØ#.õ
 €JrcóŽt|«dk\r6|d|dcxk(rdk(r%n|S|dd}dD]\}}|j||«}Œ|S)zi
Remove latex formatting from mathtext.
Only handles fully math and fully non-math strings.
éréÿÿÿÿú) )z\timesÚx)z \mathdefaultÚ)z\rmrÌ)z\calrÌ)z\ttrÌ)z\itrÌ)ú\rÌ)ú{rÌ)ú}rÌ)Úreplace)ÚtexÚplains rÚ
strip_mathrÓ½seô  ˆ1ƒv‚{‘t˜q ™uÔÔ
€Hð
ˆaˆGˆð

ò &‰JˆCð ˜#˜%‰Að 
€Hrcó2d} |jd|«}|jd|«}|dkr|dkr|n|d|}|j«Sd|cxkr|krnn|d|j«S|jd|dz«}|dkrtd|d«|dz}Œ•)z+Strip everything from the first unquoted #.rr¿ú#NrÊzMissing closing quote in: zM. If you need a double-quote inside a string, use escaping: e.g. "the " char")ÚfindÚstripÚ
ValueError)ÚposÚ quote_posÚhash_posÚwithout_commentÚclosing_quote_poss rÚ_strip_commentrÞÔà
€CØ
Ø—F‘F˜3 Ó$ˆ Ø—6‘6˜#˜sÓ#ˆØ qŠ=Ø#+¨a¢<™a°Q°y¸°\ˆ"×

&˜
Yh<× 'à !§¡ s¨I¸©MÓ :Ð Ø  1Ò Ø°ð6NðNóOðOð$ 'ˆ rcó.tt|dd««S)zDReturn whether *obj* looks like a file object with a *write* method.ÚwriteN)ÚcallableÚgetattr©rNs rÚis_writable_file_likeräèsä ”G˜C ¨$Ó 0rcóF |jd«y#t$rYywxYw)zf
Return whether the given writable file-like object requires Unicode to be
written to it.
rFT)r[©s rÚfile_requires_unicoderçís+ð
Ø Œ ðøô òÙðús Ÿ FcóŠt|tj«rtj|«}t|t«ra|j d«rt
j||«}n6|j d«rddl}|j||«}nt|||¬«}d}nt|d«r|}d}n td «|r||fS|S)
a^
Convert a path to an open file handle or pass-through a file-like object.
Consider using `open_file_cm` instead, as it allows one to properly close
newly created file objects more easily.
Parameters
----------
fname : str or path-like or file-like
If `str` or `os.PathLike`, the file is opened using the flags specified
by *flag* and *encoding*. If a file-like object, it is passed through.
flag : str, default: 'r'
Passed as the *mode* argument to `open` when *fname* is `str` or
`os.PathLike`; ignored if *fname* is file-like.
return_opened : bool, default: False
If True, return both the file object and a boolean indicating whether
this was a new file (that the caller needs to close). If False, return
only the new file.
encoding : str or None, default: None
Passed as the *mode* argument to `open` when *fname* is `str` or
`os.PathLike`; ignored if *fname* is file-like.
Returns
-------
fh : file-like
opened : bool
*opened* is only returned if *return_opened* is True.
ú.gzz.bz2rN)ÚencodingTÚseekFz'fname must be a PathLike or file handle) rRÚosÚPathLikeÚfspathÚstrÚendswithÚgzipÚopenÚbz2ÚBZ2FileÚhasattrrØ)ÚfnameÚflagÚ
return_openedrêÚfhróÚopeneds rÚ
to_filehandlerûúô:ŸÔ— ‘ ˜%Ó ˆÜÔØ >‰>˜ ܘ5 '‰BØ
^‰^˜

ؘU DÓ)‰Bäe˜T¨HÔ5ˆBØÜ ˜Ô Ø
ˆØäÐØ6ˆzÐØ
€IrcóVt||d|«\}}|r|Stj|«S)z8Pass through file objects and context-manage path-likes.T)Ú nullcontext)Ú path_or_fileÚmoderês rÚ open_file_cmr.s.ä˜|¨T°4¸ÓBJ€BˆÙˆ2Ð7œZ×3°BÓ7rcóRt|t«xstj|« S)z;Return whether the given object is a scalar or string like.)rRÚnpÚiterable©Úvals rÚis_scalar_or_stringr4s ä cœ3Ó Ò 7¤r§{¡{°3Ó'7Ð#7Ð7rcótd|«}|rs|jj«}|dk(rtj|«S|dvrt j |«S|dvr|j d«S|j d«St|«S)
Return a sample data file. *fname* is a path relative to the
:file:`mpl-data/sample_data` directory. If *asfileobj* is `True`
return a file object, otherwise just a file path.
Sample data files are stored in the 'mpl-data/sample_data' directory within
the Matplotlib package.
If the filename ends in .gz, the file is implicitly ungzipped. If the
filename ends with .npy or .npz, and *asfileobj* is `True`, the file is
loaded with `numpy.load`.
Ú sample_dataré)z.npyz.npz)z.csvz.xrcz.txtÚrb)Ú_get_data_pathÚsuffixÚlowerrñrÚloadrï)Ú asfileobjÚpathr s rÚget_sample_datar9s€ô ˜-¨Ó /€DÙØ×$ˆØ UŠ?Ü—99˜T“?Ð
Ð
—77˜4“=Ð Ø
Ð
—99˜S“>Ð —99˜T“?Ð 4rcó>ttj«g|¢­ŽS)
Return the `pathlib.Path` to a resource file provided by Matplotlib.
``*args`` specify a path relative to the base data path.
)rÚ
matplotlibÚ
get_data_path)rs rr r Usô 
× 2¨TÒ 2rc#ódK|D]%}||«s||Œt||«Ed{Œ'y7Œ­w)
Return a generator of flattened nested containers.
For example:
>>> from matplotlib.cbook import flatten
>>> l = (('John', ['Hunter']), (1, 23), [[([42, (5, 23)], )]])
>>> print(list(flatten(l)))
['John', 'Hunter', 1, 23, 42, 5, 23]
By: Composite of Holger Krekel and Luther Blissett
From: https://code.activestate.com/recipes/121294-simple-generator-for-flattening-nested-containers/
and Recipe 1.12 in cookbook
N)Úflatten)r¸ÚscalarpÚitems rrr^s<èø€ðòÙ 4Œ=˜D˜LØ‹Jä˜t -× 
.ús $0¦.§0cóFeZdZdZdZdZdZdZdZdZ dZ
d „Z d
Z y ) Ú_Stackzb
Stack of elements with a movable cursor.
Mimics home/back/forward in a web browser.
có d|_g|_y)NrÈ©Ú_posÚ _elementsrs rrz_Stack.__init__{s؈Œ ؈rcó d|_g|_y)zEmpty the stack.rÈNrrs rÚclearz _Stack.clearsàˆŒ ؈rcóP|jr|j|jSdS)z$Return the current element, or None.N)rrrs rrPz_Stack.__call__„s à,0¯NªNˆt~‰~˜dŸi™iÑÐDrcó,t|j«Sr
)rrs rÚ__len__z_Stack.__len__ˆsÜ4—>"rcó |j|Sr
)r)rÚinds rrqz_Stack.__getitem__sØ~‰~˜"rcóxt|jdzt|j«dz
«|_|«S)z9Move the position forward and return the current element.rÊ)Úminrrrs rÚforwardz_Stack.forwardŽs-䘟 ™  A™
¤s¨4¯>©>Ó':¸QÑ'>Ó?ˆŒ Ùvˆ
rcóLt|jdz
d«|_|«S)z6Move the position back and return the current element.rÊr)Úmaxrrs rÚbackz _Stack.back“s䘟 ™  A™
 )ˆŒ Ùvˆ
rcóz|g|j|jdzdt|j«dz
|_|S)zx
Push *o* to the stack after the current position, and return *o*.
Discard all later elements.
N)rr)rÚos rÚpushz _Stack.push˜s8ð +,¨ˆt—yy 1}˜ŸÓ'¨!ÑŒ ؈rcóZ|jr|j|jd«SdS)zk
Push the first element onto the top of the stack.
The first element is returned.
rN)rr.rs rÚhomez _Stack.home¢s'ð 04¯~ª~ˆty‰y˜Ÿ¨ÑGÀ4ÐGrN)
rrrrrr rPr#rqr(r+r.r0r rrrrts6ñò òò
Eòò
ò
óHrrcóftj|d|¬«}|jjs:|j |¬«j |jj
d««} tjjtj|«|d¬«}|S#t$r|cYSwxYw)NT)ÚsubokÚcopy)ÚinplaceÚNF)r3) rÚarrayÚdtypeÚisnativeÚbyteswapÚviewÚ newbyteorderÚmaÚ masked_whereÚisfiniter[)r3Úxms rÚsafe_masked_invalidr@«s•Ü
˜$ TÔ*€AØ 7‰7× Ò ð
J‰J˜tˆ $× )¨!¯'©'×*>Ñ*>¸sÓ*CÓ DˆðÜ
U‰U×
Ñ
¤"§+¡+¨a£.Ð 1°1¸
Ó
ð €Iøô òØŠðúsÁ*6B"Â" B0Â/B0có„ddlŠˆfdŠˆˆˆˆˆˆfdŠD]"}jd|d«||ig«Œ$y)
Print loops of cyclic references in the given *objects*.
It is often useful to pass in ``gc.garbage`` to find the cycles that are
preventing some objects from being garbage collected.
Parameters
----------
objects
A list of objects to find cycles in.
outstream
The stream for output.
show_progress : bool
If True, print the number of objects reached as they are found.
rNcórt|«D]\}}||dzt|«z}jdt|«z«t |t
«rN|j
«D]:\}}||urjd|d«n||usŒ&‰jd|«nrnpt |t«r$‰jd|j|«z«n<t |t«rjd«njt|««jd«Œjd «y)
NrÊz %s -- ú]z[key] = z[%d]z ( tuple )z ->
ú
) rirrRÚdictrˆr|ÚindexÚtupleÚrepr)rrmÚstepr‰rkrÚ outstreams €rÚ
print_pathz print_cycles.<locals>.print_pathËs
ø€Ü  ó %‰GˆAˆtà˜˜Q™¤# d£)Ñ,ˆDà O‰O˜K¬$¨t«*Ñ ˜$¤Ô%Ø $§
¡
£ ò‘Hؘd‘{ب!¨C¨7°!¨ ÔØ˜d’{ب(°3°'Ð(:Ôñ
ô˜D¤$Ô ¨¯©°DÓ)9Ñ 9Õ˜D¤%Ô  Õ¤ T£
Ô O‰O˜ $ð' %ð( ˜Õrcó" rjdt|«z«d|t|«<j|«}|D]K}||ur ‰ |«Œ|ust |t
j «rŒ/t|«|vsŒ=
|||||gz«ŒMy)Nz%d
)ÚidÚ
get_referentsrRÚtypesÚ FrameType) rNÚstartÚallÚ current_pathÚ referentsÚreferentÚgcÚobjectsrKrLÚrecurseÚ
show_progresss €€€€€€rrYzprint_cycles.<locals>.recurseâs˜ø€Ù Ø O‰O˜F¤S¨£XÑ ˆŒBˆs‹G‰ à×$ SÓ)ˆ Ø Dˆ˜ Ù˜
˜
°8¼U¿_¹_Ô(MØôH“ SÒ˜ %¨¨l¸c¸UÑ.BÕ Drz Examining: rE)rW)rXrKrZrNrWrLrYs``` @@@rÚ print_cyclesr[¹sMý€ó ô÷.DñDð.ò"ˆØ˜+ c W¨BÐS˜"˜"rcóHeZdZdZd dZdZdZdZdZdZ dZ
d „Z d
Z y )
ÚGroupera#
A disjoint-set data structure.
Objects can be joined using :meth:`join`, tested for connectedness
using :meth:`joined`, and all disjoint sets can be retrieved by
using the object as an iterator.
The objects being joined must be hashable and weak-referenceable.
Examples
--------
>>> from matplotlib.cbook import Grouper
>>> class Foo:
... def __init__(self, s):
... self.s = s
... def __repr__(self):
... return self.s
...
>>> a, b, c, d, e, f = [Foo(x) for x in 'abcdef']
>>> grp = Grouper()
>>> grp.join(a, b)
>>> grp.join(b, c)
>>> grp.join(d, e)
>>> list(grp)
[[a, b, c], [d, e]]
>>> grp.joined(a, b)
True
>>> grp.joined(a, c)
True
>>> grp.joined(a, d)
False
c ó^tj|Dcic]}|tj|g«Œc}«|_tj«|_|D]3}||jvsŒt |j«|j|<Œ5t |j«|_ycc}wr
)rYÚWeakKeyDictionaryÚWeakSetÚ_mappingÚ _orderingr¦Ú _next_order)rÚinitrËs rrzGrouper.__init__ Ü×1Ø.2Ö ˆQ”  Ó
5ˆŒ
ä ׌Øò 8ˆAؘŸÒ&Ü$'¨¯©Ó$7˜qÒ˜tŸ~™~ÓÕùò
4sB*c ó´it|«¥|jj«Dcic]\}}|t|«Œc}}i|j¥dœ¥Scc}}w)N)rarb)r‡rarˆr„rbrvs rzGrouper.__getstate__)sXð
Ü4
ð04¯}©}×/BÑ/BÓ/D×E¡t q¨!˜œC F™Ó+˜DŸN™NÐ
ð
ùóFsªAc
ó>t|«j|«tj|jj «Dcic]\}}|tj |«Œc}}«|_tj|j«|_ycc}}wr
)r‡r“rYr_rarˆr`rb)rr—rfrgs rr™zGrouper.__setstate__1spÜ ˆT
×ј%Ô ä×1Ø/3¯}©}×/BÑ/BÓ/D× E¡t q¨!ˆQ” Ó
GˆŒ
ä ×2°4·>±>ÓBˆùó
FsÁ B
có||jvSr
)ra©rrs rÚ __contains__zGrouper.__contains__8sØt—}$rcó|j} ||}|D]E} ||}||usŒt
|«t
|«kDr||}}|j|«|D]}|||<Œ ŒGy#t$rLtj|g«x}||<|j|j
|<|xjdz
c_YŒŸwxYw#t$rLtj|g«x}||<|j|j
|<|xjdz
c_YΓwxYw)zY
Join given arguments into the same set. Accepts one or more arguments.
N)rarprYr`rcrbr“)rÚarÚmappingÚset_aÚargÚset_bÚelems rÚjoinz Grouper.join;sð—--ˆð˜AJˆ
ò *ˆ
  ð
˜EÒu“:¤ E£
Ò*Ø#(¨%˜5 ˜*DØ$)G˜D *øô ò "Ü!(§¡°!°Ó!5Ð 5ˆEG˜A‘JØ $× 0Ñ 0ˆDN‰N˜1Ñ Ø × Ò  Ñ ð "ûôò
&Ü'.§¡¸°uÓ'=Ð=˜  Ø&*×&6Ñ&6˜× Ò  AÑ ð
&ús$ŽAB6ÁAB3Â2B3Â6AD Ä
D có€|jj|t««|jj|«uS)z7Return whether *a* and *b* are members of the same set.)rar/Úobject©rrkÚbs rÚjoinedzGrouper.joinedTs/à
×! !¤V£XÓ.°$·-±-×2CÑ2CÀAÓ2FÐGrcó”|jj||h«j|«|jj|d«y)z>Remove *a* from the grouper, doing nothing if it is not there.N)rartÚremoverb©rrks rrxzGrouper.removeXs7à
×ј!˜a˜SÓÔ ×ј1˜dÕ#rc#óèK|jj«Dcic]}t|«|Œ}}|j«D]%}t||jj
¬«Œ'ycc}w­w)z‰
Iterate over each of the disjoint sets as a list.
The iterator is invalid if interleaved with calls to join().
©rkN)rar;rNÚsortedrbrq)rÚgroupÚ
unique_groupss rrwzGrouper.__iter__]shèø€ð 8<·}±}×7KÑ7KÓ7MÖN¨eœ˜E 
Ð"× @ˆ˜ D§N¡N×$>Ñ$>Ô  @ùòOùsA2ŸA-²AA2có~|jj||g«}t||jj¬«S)z:Return all of the items joined with *a*, including itself.r{)rar/r|rb)rrkÚsiblingss rÚ get_siblingszGrouper.get_siblingsgs1à—=$ Q¨¨ÓÜh D§N¡N×$6Ñ$6Ô7rN)r )
rrrrrr™rirqrvrxrwrr rrr]r]þs8ñóB
òCò*ò2Hò
@ó8rr]có.eZdZdZdZdZdZdZdZy)Ú GrouperViewz!Immutable view over a `.Grouper`.có||_yr
©Ú_grouper)rÚgroupers rrzGrouperView.__init__ps° ¥rcó||jvSr
r…rhs rrizGrouperView.__contains__qs¨°·±Ð)>Ð">rcó,t|j«Sr
)Úiterr†rs rrwzGrouperView.__iter__rsœt D§M¡MÓ2rcó:|jj||«S)zI
Return whether *a* and *b* are members of the same set.
)r†rvrts rrvzGrouperView.joinedtsð}‰}×# A )rcó8|jj|«S)zL
Return all of the items joined with *a*, including itself.
)r†rrys rrzGrouperView.get_siblingszsð}‰}×)¨!Ó,rN) rrrrrrirwrvrr rrmsÙ -rc
óª|jt|«df«}tjt|««|z}tjt|«dz
|zdz«}tj|j
Dcgc]}tj |||«Œc}«jt|«f|jddz«Scc}w)a}
Resample an array with ``steps - 1`` points between original point pairs.
Along each column of *a*, ``(steps - 1)`` points are introduced between
each original values; the values are linearly interpolated.
Parameters
----------
a : array, shape (n, ...)
steps : int
Returns
-------
array
shape ``((n - 1) * steps + 1, ...)``
N)Úreshaper¦rÚarangeÚ column_stackÚinterpÚshape)rkÚstepsÚfpsÚxprËÚfps rÚsimple_linear_interpolationr˜s ð" )‰)”S˜“V˜R
!€CÜ ”3q“6Ó ˜UÑ "€BÜ
‰ ”3q“6˜A: ÑÑ+€AÜ O‰O¸C¿E¹EÖB°bœRŸY™Y q¨"¨bÕ
‰W”c˜!“f§¡¨¨ Ñ
/ùÒBsÂCcó"t|«syt|d«r td«t|d«}g}dgt|«z}t|«D\}}t |t
«s{t
j|«rft|«|k(rXd||<t |t jj«r|jdkDr td«t
j|«}|j|«Œ£g}t|«D\}}||sŒ |jdkDrŒt |t jj«r<|jt jj|««|j}n|} t
j|«}t |t j «r|j|«ŒÀt|«rat j$j'|«}|j)«d} t| «|kr!t|«D]\}}||sŒ || ||<Œt|«D]C\}}||sŒ t |t jj«sŒ1|j+«||<ŒE|S#t"$rYŒŒwxYw)ak
Find all masked and/or non-finite points in a set of arguments,
and return the arguments with only the unmasked points remaining.
Arguments can be in any of 5 categories:
1) 1-D masked arrays
2) 1-D ndarrays
3) ndarrays with more than one dimension
4) other non-string iterables
5) anything else
The first argument must be in one of the first four categories;
any argument with a length differing from that of the first
argument (and hence anything in category 5) then will be
passed through unchanged.
Masks are obtained from all arguments of the correct length
in categories 1, 2, and 4; a point is bad if masked in a masked
array or if it is a nan or inf. No attempt is made to
extract a mask from categories 2, 3, and 4 if `numpy.isfinite`
does not yield a Boolean array.
All input arguments that are not passed unchanged are returned
as ndarrays after removing the points or rows corresponding to
masks in any of the arguments.
A vastly simpler version of this function was originally
written as a helper for Axes.scatter().
r rú!First argument must be a sequenceFTrÊúMasked arrays must be 1-D)rrirRrrr<Ú MaskedArrayÚndimÚasarrayrjÚ getmaskarrayÚdatar>ÚndarrayrªÚ logical_andÚreduceÚnonzeroÚfilled)
rÚnrecsÚmargsÚseqlistrmÚmasksÚxdÚmaskÚigoods
rÚdelete_masked_pointsr­s.ô@ ˆtŒ9ØÜ˜4 ™7ÔÐ Q‘‹L€EØ €E؈gœ˜D› Ñ!€Gܘ$“òˆˆ1ܘ!œSÔ!¤b§k¡k°!¤n¼¸Q»À5ºØˆGA‰Jܘ!œRŸU™U×—6‘6˜A’:Ü$Ð%@Ó—JJ˜q“MØ
Qðð
€Eܘ%Ó òˆˆ1Ø 1‹:Øv‰v˜ŠzØÜ˜!œRŸU™U× œbŸe™e×Ó—V‘V‘àð
Ü—{‘{ 2“ܘd¤B§J¡JÔ—L‘L Ô&øðô ˆ5„zÜ~‰~×$ UÓØ ˜qÑÜ ˆu‹:˜Ò Ü! %Ó
(‘˜1“:Ø  ™xE˜!’Hð
˜ ò"‰ˆˆ1Ø 1:œ* ¯©×(9Ñ(9Õ—xx“zˆE!ŠHð €Løôò
Úð
úsÆAJÊ JÊ
Jcóät|«syt|d«r td«t|d«}g}dgt|«z}g}t|«D]\}}t|«st|«|k7r|j |«Œ2t |t jj«r|jdkDr td« t
j|«}|jdk(r]t|«}d||<t jj|«r.|j t jj|««|j |«Œt|«r\t j j#|«}t|«D]/\}}||sŒ t jj%||¬ «||<Œ1|S#ttf$rt
j|t¬«}YŒwxYw)
ax
Find all masked and/or non-finite points in a set of arguments,
and return the arguments as masked arrays with a common mask.
Arguments can be in any of 5 categories:
1) 1-D masked arrays
2) 1-D ndarrays
3) ndarrays with more than one dimension
4) other non-string iterables
5) anything else
The first argument must be in one of the first four categories;
any argument with a length differing from that of the first
argument (and hence anything in category 5) then will be
passed through unchanged.
Masks are obtained from all arguments of the correct length
in categories 1, 2, and 4; a point is bad if masked in a masked
array or if it is a nan or inf. No attempt is made to
extract a mask from categories 2 and 4 if `numpy.isfinite`
does not yield a Boolean array. Category 3 is included to
support RGB or RGBA ndarrays, which are assumed to have only
valid values and which are passed through unchanged.
All input arguments that are not passed unchanged are returned
as masked arrays if any masked points are found, otherwise as
ndarrays.
r rFrÊr©r7)rrirjrRrr<rÚ
asanyarrayrrsr@Ú is_maskedrŸÚ
logical_orr£r6)rrms rÚ_combine_masksr´æs™ô> ˆtŒ9ØÜ˜4 ™7ÔÐ Q‘‹L€EØ €E؈gœ˜D› Ñ!€GØ €Eܘ$“óˆˆ1Ü ˜qÔ !¤S¨£V¨u¢_Ø L‰L˜˜!œRŸU™U×/°A·F±F¸Q²JÜ Ð!<Ó
—MM $ð
v‰v˜Š{ÜÓ*Ø!˜
Ü—5‘5—?‘? 1Ô—L‘L¤§¡×!3Ñ!3°AÓ!6Ô L‰L˜ŽOð#ô$ ˆ5„zÜ}‰}×# EÓܘeÓ 5‰DˆAˆqØqŸ5™5Ÿ;™; q¨t˜4að €Løô.¬zÐ
—M‘M !¬6Ô2“ð
3úsÃGÇ*G/Ç.G/)ÚcompresscóÖ|Dcgc]3}t|tjj«sŒ(|jŒ5}}tj
g|¢|¢­Ž}|dt
|«}|t
|«d}|r¿tjj|«}|r>|Dcgc]1}tjj||¬«j«Œ3}}|S|Dcgc]S}tjj||t¬«jtj«j«ŒU}}|S|Dcgc]}tj|«Œ}}|Scc}wcc}wcc}wcc}w)aw
Broadcast inputs, combining all masked arrays.
Parameters
----------
*args : array-like
The inputs to broadcast.
compress : bool, default: False
Whether to compress the masked arrays. If False, the masked values
are replaced by NaNs.
Returns
-------
list of array-like
The broadcasted and masked inputs.
Nr°)r7)rRrr<Úbroadcast_arraysr¦r6Ú
compressedÚfloatr¥ÚnanÚravel)rrfÚbcastÚinputsr«s rÚ_broadcast_with_masksr¾'sFð$ F˜¤Z°´2·5±5×3DÑ3DÕ%EˆQV‹VÐ F€EÐ × Ñ Ð Ð Ò .€EØ
:”C˜“IÐ
€FØ ”#d“) €EÙ ä}‰}×# EÓ*ˆá àô—ee—kk !¨$/×'ˆ €Mðô—ee—kk !¨$´e<×CÄBÇFÁFÓK×'ˆ €Mð(.Ö. !”"—((˜1•+Ð.ˆÐ €Mùò#
Gùò'ùò'ùò/s…)E¯EÂ6EÃAE!Ä7E&có²ddŠˆfd}g}t|d«}t|«}|tjd«}nt|«|k7r t d«|}t t
||««D\} \}
} i} | | | d<|}|j| «t|
«dk(rÄtjg«| d<tj| d <tj| d
<tj| d <tj| d <tj| d
<tj| d<tj| d<tj| d<tj| d<οtjj|
«}
|
j|
jj«}
tj |
«| d <tj"|
gd¢«\}
}}||
z
| d
<| d
dk(r|rd}||
|| d
|«\| d<| d<tj$|«r*t'|t(«stj"|
|«\}}n7tj*|«r|
|| d
zz
}||| d
zz}n t d«|
|
|k}t|«dk(stj,|«|kr|| d<ntj,|«| d<|
|
|k\}t|«dk(stj.|«|
kDr|
| d<ntj.|«| d<tj0|
|
| dk|
|
| dkDg«| d<|
||c| d <| d
<| d <ΐ|S)aj
Return a list of dictionaries of statistics used to draw a series of box
and whisker plots using `~.Axes.bxp`.
Parameters
----------
X : array-like
Data that will be represented in the boxplots. Should have 2 or
fewer dimensions.
whis : float or (float, float), default: 1.5
The position of the whiskers.
If a float, the lower whisker is at the lowest datum above
``Q1 - whis*(Q3-Q1)``, and the upper whisker at the highest datum below
``Q3 + whis*(Q3-Q1)``, where Q1 and Q3 are the first and third
quartiles. The default value of ``whis = 1.5`` corresponds to Tukey's
original definition of boxplots.
If a pair of floats, they indicate the percentiles at which to draw the
whiskers (e.g., (5, 95)). In particular, setting this to (0, 100)
results in whiskers covering the whole range of the data.
In the edge case where ``Q1 == Q3``, *whis* is automatically set to
(0, 100) (cover the whole range of the data) if *autorange* is True.
Beyond the whiskers, data are considered outliers and are plotted as
individual points.
bootstrap : int, optional
Number of times the confidence intervals around the median
should be bootstrapped (percentile method).
labels : list of str, optional
Labels for each dataset. Length must be compatible with
dimensions of *X*.
autorange : bool, optional (False)
When `True` and the data are distributed such that the 25th and 75th
percentiles are equal, ``whis`` is set to (0, 100) such that the
whisker ends are at the minimum and maximum of the data.
Returns
-------
list of dict
A list of dictionaries containing the results for each column
of data. Keys of each dictionary are the following:
======== ===================================
Key Value Description
======== ===================================
label tick label for the boxplot
mean arithmetic mean value
med 50th percentile
q1 first quartile (25th percentile)
q3 third quartile (75th percentile)
iqr interquartile range
cilo lower notch around the median
cihi upper notch around the median
whislo end of the lower whisker
whishi end of the upper whisker
fliers outliers
======== ===================================
Notes
-----
Non-bootstrapping approach to confidence interval uses Gaussian-based
asymptotic approximation:
.. math::
\mathrm{med} \pm 1.57 \times \frac{\mathrm{iqr}}{\sqrt{N}}
General approach from:
McGill, R., Tukey, J.W., and Larsen, W.A. (1978) "Variations of
Boxplots", The American Statistician, 32:12-16.
cóÐt|«}ddg}tjj|||f¬«}||}tj|dd¬«}tj
||«}|S)Ng@g`X@)ÚsizerÊT)ÚaxisÚoverwrite_input)rÚrandomÚrandintÚmedianÚ
percentile)r r5Ú percentilesÚbs_indexÚbsDataÚestimateÚCIs rÚ_bootstrap_medianz(boxplot_stats.<locals>._bootstrap_medianœsaä ‹IˆØ˜D ä—9‘9×$ Q¨a°¨VÐØh‘ˆÜ—9‘9˜V¨!¸TÔä
]‰]˜8 
1ˆØˆ rcóÎ|||¬«}|d}|d}||fSt|«}|d|ztj|«z z
}|d|ztj|«z z}||fS)N)r5rg…ëQ¸ù?)rÚsqrt) r ÚmedÚiqrÚ bootstraprÍÚ notch_minÚ notch_maxr5s €rÚ_compute_conf_intervalz-boxplot_stats.<locals>._compute_conf_interval¨sø€Ø Ð ñ# 4¨9Ô5ˆBؘ1™ˆIؘ1™ˆIð˜)ÐD“ ˆAؘd S™j¬2¯7©7°1«:Ñ5ˆIؘd S™j¬2¯7©7°1«:Ñ5ˆIà˜#rÚXNz-Dimensions of labels and X must be compatibleÚlabelrÚfliersÚmeanrÑÚq1Úq3rÒÚciloÚcihiÚwhisloÚwhishi)éé2éK)rédz+whis must be a float or list of percentiles)iˆ)Ú _reshape_2Dr¦r€ÚrepeatrØriÚziprjrr6r<r rrRÚisrealr*r'Ú concatenate)r×ÚwhisrÓÚlabelsÚ autorangerÖÚbxpstatsÚncolsÚ
input_whisÚiirËÚstatsrÛÚlovalÚhivalÚwiskhiÚwisklorÎs @rÚ
boxplot_statsröMs8ø€ó^
ô
€Hô A€Aä F€EØ
€~Ü×! '‰Ü ˆV˜Ò ÜЀJÜ#¤C¨¨6£NÓM=‰ˆ‰JˆQðˆØ Ð Ø"ˆE'‰Nðˆð ˜Ôô ˆq‹6QŠ;Ü Ÿh™h rlˆE(‰OÜŸF™FˆE&‰MÜŸ6™6ˆE%‰LÜŸ&™&ˆE$‰KÜŸ&™&ˆE$‰KÜŸ6™6ˆE%‰LÜŸF™FˆE&‰MÜŸF™FˆE&‰MÜ Ÿf™fˆE(‰OÜ Ÿf™fˆE(‰OØ ô
E‰EM‰M˜ ˆØ
F‰FA—FF7‰O× ôŸ 
ˆˆf‰
ô—m‘m A¢|Ó4‰ ˆˆCð˜B‘wˆˆe‰ Ø ‰<˜ ¡Øˆ(>Ø
ˆsE˜%L (
Ñ$ˆˆf‰
u˜V
;‰; ¤Z°´cÔ%:ÜŸ=™=¨¨DÓ1‰LˆE‘5Ü
Y‰YtŒ_ؘ  e¡ Ñ,ˆEؘ  e¡ Ñ,‰EäÐ ‘:‘ˆÜ ˆv‹;˜!Ò œrŸv™v f›~°Ò ˆE(ŠOä Ÿf™f V›nˆE(‰Oð‘:‘ˆÜ ˆv‹;˜!Ò œrŸv™v f›~°Ò ˆE(ŠOä Ÿf™f VnˆE(‰OôŸ.™.Ø
ˆa%˜
ˆa%˜ *
ó ˆˆh‰ð 24°S¸"Ð.ˆˆd‰ U˜5\ £;ð[M=ð^ €OrÚsolidÚdashedÚdashdotÚdotted)ú-z--z-.ú:c óTtj|t¬«}|jsgStj|dd|ddk7«\}|dz
}|j «}|drdg|z}|dr|j
t|««tt|ddd|ddd««S)zv
Return a list of (ind0, ind1) such that ``mask[ind0:ind1].all()`` is
True and we cover all such regions.
NrÈr)
rÚboolrÁÚtolistrjr|)Úidxs rÚcontiguous_regionsrô
:‰:d¤$Ô '€Dà 9Š9؈ ô :‰:d˜3˜Bi ¨  ,D€C؈1H€Cð *‰*‹,€Cð ˆA‚w؈cC‰iˆØ ˆB‚xØ
”3t“9Ôä C™˜!˜H˜c ! $ Q $™iÓ )rcó€t|«}|jd«|jd«z
}|dkDxr|dzdk(}|S)
Return whether the string *s* contains math expressions.
This is done by checking whether *s* contains an even number of
non-escaped dollar signs.
z\$r)r)Ú dollar_countÚ even_dollarss rÚ is_math_textr6sFô ˆA‹€AØ—7‘7˜4“= 1§7¡7¨5£>Ñ1€LØ  ¸Ñ)9¸QÑ)>€LØ ÐrcóÐt|d«rAtjj|t«j tj «Stj|t«S)zt
Convert a sequence to a float array; if input was a masked array, masked
values are converted to nans.
)rr<s rÚ_to_unmasked_float_arrayrCsCô
ˆqÜu‰u}‰}˜Ó&×-¬b¯f©fÓz‰z˜!œUÓ#rcó¦t|«}t|d«r$t|d«rt|j«dkrt j
|«S|S)z8Convert scalars to 1D arrays; pass-through arrays as is.r“r)Ú_unpack_to_numpyrõr“rÚ
atleast_1dræs rÚ _check_1dr NsHô ˜Ó€Aô
A ܘ˜6Ô ‹L˜1Ò Ü}‰}˜QÓÐàˆrcóôt|«}t|tj«rŽ|j «}t |«dk(rggS|j dk(rtj |d«dk(r|gS|j dvr$|Dcgc]}tj|d«Œc}St|d«t |«dk(rggSg}d}|D]}}t|t«s t|«d}tj|«}tj |«}|dkDrt|d«|j|jd««Œ|rtj|d«gS|Scc}w#t$rYŒŠwxYw)
Use Fortran ordering to convert ndarrays and lists of iterables to lists of
1D arrays.
Lists of iterables are converted by applying `numpy.asanyarray` to each of
their elements. 1D ndarrays are returned in a singleton list containing
them. 2D ndarrays are converted to the list of their *columns*.
*name* is used to generate the error message for invalid inputs.
r)z must have 2 or fewer dimensionsTF)r rRrÚ transposer¦rr[rj)r×ÚnamerËÚresultÚis_1dÚxiÚnds r]siô ˜Ó€Aô!”R—Z‘ZÔ Ø
K‰K‹Mˆä ˆq‹6QŠ;Ø4ˆKØ
V‰VqŠ[œRŸW™W Q q¡T]¨aÒ3ˆ
V‰V
à/0Ö1¨!”B—JJ˜q   ˜vÐ%EÐ  ˆ1ƒv‚{؈tˆ à
€FØ €EØò&ˆô˜"œcÔ
ÜR”ðÜ
]‰]˜
ˆÜ
W‰WR[ˆØ
Š6Ü ˜vÐ%EÐ 
b—jj “nÕ
ä
˜6 ˆ
ùò?2øô ò
Ùð
úsÂE&Ã E+Å+ E7Å6E7có†g}t|d«}|t|«dk7r
t|d«}nggt|«z}t|«t|«k7r td«t||«D\}}i}t j
|«}t j |«} t j|d|z«}
t j|| |«} ||| «|d<| |d<t j|«|d<t j|«|d <||d
<| |d <t j|
«|d<|j|«Œ×|S) a[
Return a list of dictionaries of data which can be used to draw a series
of violin plots.
See the ``Returns`` section below to view the required keys of the
dictionary.
Users can skip this function and pass a user-defined set of dictionaries
with the same keys to `~.axes.Axes.violinplot` instead of using Matplotlib
to do the calculations. See the *Returns* section below for the keys
that must be present in the dictionaries.
Parameters
----------
X : array-like
Sample data that will be used to produce the gaussian kernel density
estimates. Must have 2 or fewer dimensions.
method : callable
The method used to calculate the kernel density estimate for each
column of data. When called via ``method(v, coords)``, it should
return a vector of the values of the KDE evaluated at the values
specified in coords.
points : int, default: 100
Defines the number of points to evaluate each of the gaussian kernel
density estimates at.
quantiles : array-like, default: None
Defines (if not None) a list of floats in interval [0, 1] for each
column of data, which represents the quantiles that will be rendered
for that column of data. Must have 2 or fewer dimensions. 1D array will
be treated as a singleton list containing them.
Returns
-------
list of dict
A list of dictionaries containing the results for each column of data.
The dictionaries contain at least the following:
- coords: A list of scalars containing the coordinates this particular
kernel density estimate was evaluated at.
- vals: A list of scalars containing the values of the kernel density
estimate at each of the coordinates given in *coords*.
- mean: The mean value for this column of data.
- median: The median value for this column of data.
- min: The minimum value for this column of data.
- max: The maximum value for this column of data.
- quantiles: The quantile values for this column of data.
r×rÚ quantileszLList of violinplot statistics and quantiles values must have the same lengthräÚvalsÚcoordsrÚr'r*)
rr'r*ÚlinspacerÚr
rj) r×ÚmethodÚpointsrÚvpstatsrËÚqrñÚmin_valÚmax_valÚ quantile_valrs rÚ violin_statsrsHðj€Gô A€AðФ Y£°1Ò!4Ü  ¨;Ó7‰ ðDœ3˜q›6‘Mˆ ô ˆ1ƒv”Y“ÒÜðÓˆˆAàˆô—&&˜“)ˆÜ—&&˜“)ˆÜ—}} Q¨¨a©Ó ô˜W g¨vÓÙ˜q )ˆˆf‰
Ø ˆˆh‰ôŸ 
ˆˆf‰
ÜŸ)™) A›,ˆˆh‰Øˆˆe‰ ؈ˆe‰ ÜŸ]™]¨<ÓˆkÑð ð-ð0 €Nrc óútjdt|«ztdt|«zdz
d«f«}||ddddf<|ddddf|ddddf<||dddddf<|dddddf|dddddf<|S)a(
Convert continuous line to pre-steps.
Given a set of ``N`` points, convert to ``2N - 1`` points, which when
connected linearly give a step function which changes values at the
beginning of the intervals.
Parameters
----------
x : array
The x location of the steps. May be empty.
y1, ..., yp : array
y arrays to be turned into steps; all must be the same length as ``x``.
Returns
-------
array
The x and y values converted to steps in the same order as the input;
can be unpacked as ``x_out, y1_out, ..., yp_out``. If the input is
length ``N``, each of these arrays will be length ``2N + 1``. For
``N=0``, the length will be 0.
Examples
--------
>>> x_s, y1_s, y2_s = pts_to_prestep(x, y1, y2)
rNéþÿÿÿ©rÚzerosr¦r*©rr”s rÚpts_to_prestepr%ûô8
H‰Haœ#˜d›)‘m¤S¨¬S°«V©°a©¸Ó%;Ð =€Eð€Eˆ!ˆQˆTˆTˆ'˜1˜a  1˜f˜%€Eˆ!ˆQˆTˆTˆ'€Eˆ!‰"ˆaˆdˆdˆ(˜A™B   1 ˜Ho€Eˆ!‰"ˆaˆdˆdˆ( €Lrc óútjdt|«ztdt|«zdz
d«f«}||ddddf<|ddddf|ddddf<||dddddf<|dddddf|dddddf<|S)a#
Convert continuous line to post-steps.
Given a set of ``N`` points convert to ``2N + 1`` points, which when
connected linearly give a step function which changes values at the end of
the intervals.
Parameters
----------
x : array
The x location of the steps. May be empty.
y1, ..., yp : array
y arrays to be turned into steps; all must be the same length as ``x``.
Returns
-------
array
The x and y values converted to steps in the same order as the input;
can be unpacked as ``x_out, y1_out, ..., yp_out``. If the input is
length ``N``, each of these arrays will be length ``2N + 1``. For
``N=0``, the length will be 0.
Examples
--------
>>> x_s, y1_s, y2_s = pts_to_poststep(x, y1, y2)
rNr!r"r$s rÚpts_to_poststepr'!ô8
H‰Haœ#˜d›)‘m¤S¨¬S°«V©°a©¸Ó%;Ð =€EØ€Eˆ!ˆQˆTˆTˆ'˜1˜a˜d ˜d˜7^€Eˆ!ˆQˆTˆTˆ'€Eˆ!‰"ˆaˆdˆdˆ(˜A™B  " Q ˜'€Eˆ!‰"ˆaˆdˆdˆ( €LrcóBtjdt|«zdt|«zf«}tj|«}|dd|ddzdz x|ddddf<|ddddf<|dd|dddf<|dd|dddf<||dddddf<|dddddf|dddddf<|S)
Convert continuous line to mid-steps.
Given a set of ``N`` points convert to ``2N`` points which when connected
linearly give a step function which changes values at the middle of the
intervals.
Parameters
----------
x : array
The x location of the steps. May be empty.
y1, ..., yp : array
y arrays to be turned into steps; all must be the same length as
``x``.
Returns
-------
array
The x and y values converted to steps in the same order as the input;
can be unpacked as ``x_out, y1_out, ..., yp_out``. If the input is
length ``N``, each of these arrays will be length ``2N``.
Examples
--------
>>> x_s, y1_s, y2_s = pts_to_midstep(x, y1, y2)
NrÈr)rr#r$s rÚpts_to_midstepr)Eô8
H‰Haœ#˜d)m Q¬¨Q«¡ZÐ 1€EÜ
€AØ)*¨3¨B¨°!°A°B°%©¸1Ñ(<Ð<€Eˆ!ˆQˆr!ˆVˆu˜Q   1 ˜WRa5€Eˆ!ˆRˆaˆRˆ%bcF€Eˆ!ˆR‰Sˆ&€Eˆ!‰"ˆaˆdˆdˆ(˜A™B   1 ˜Ho€Eˆ!‰"ˆaˆdˆdˆ( €Lrcó
||fSr
r )Úys rú<lambda>r,ks
¨A¨q¨6€r)Údefaultr”z steps-prez
steps-postz steps-midcó  |jj«|j«fS#t$rYnwxYw t|«}t j
|j dt¬«|fS#ttf$r
Ytd«wxYw)
A helper function to create reasonable x values for the given *y*.
This is used for plotting (x, y) if x values are not explicitly given.
First try ``y.index`` (assuming *y* is a `pandas.Series`), if that
fails, use ``range(len(y))``.
This will be extended in the future to deal with more types of
labeled data.
Parameters
----------
y : float or array-like
Returns
-------
x, y : ndarray
The x and y values to plot.
rz5Input could not be cast to an at-least-1D NumPy array)
rGÚto_numpyÚAttributeErrorr rrr“r)r+s rÚindex_ofr1rð*
Øw‰w×ÑÓ! 1§:¡:£<Ð/øÜ ò
Ù ð
úð aLˆô
y‰y˜Ÿ ¬5Ô1°1Ð4øô
&¤zÐ 
à ô Ð
 
ús),¬ 8·8¼ A1Á1B
 B
có°t|tjj«r |dSt
t|««S#t$r
Yt d«wxYw)
Return the first element in *obj*.
This is a type-independent way of obtaining the first element,
supporting both index access and the iterator protocol.
rú/matplotlib does not support generators as input)rRÚ collectionsÚabcÚIteratorr[Ú RuntimeErrorr‰s rÚsafe_first_elementr8sVô#”{—×
 Øq‘6ˆMô S“ ‹?Ðøôò Ø ÜÐ ús¦?¿ AÁAcóàd}t|tj«r|dSt|tjj
«r t
d«|D]}||«sŒ |cSt|«S)a:
Return the first finite element in *obj* if one is available and skip_nonfinite is
True. Otherwise, return the first element.
This is a method for internal use.
This is a type-independent way of obtaining the first finite element, supporting
both index access and the iterator protocol.
cóÖ|y tj|«S#ttf$rYnwxYw t j
|«rt j|«SdS#t$rYywxYw)NFT)Úmathr>r[rÚisscalarrs rÚ
safe_isfinitez)_safe_first_finite.<locals>.safe_isfinite³soØ ˆð Ü—=‘= Ó %øÜœ:Ð ñ
ð  úð
 Ü')§{¡{°3Ô'7”2—;;˜ A¸ AøÜò ñð ús#š,«,°)AÁAÁ A(Á'A(rr3)rRrÚflatiterr4r5r6r7r8)rNr=rs rÚ_safe_first_finiter?©siòô"#”r—{1‰vˆ
Ü Ÿ×1Ô 2ÜÐò ˆCÙ˜SÕ
ð ô" &rcódt|tjj«r t |«S|S)zP
Convert dictview objects to list. Other inputs are returned unchanged.
)rRr4r5Ú MappingViewr|)r s rÚsanitize_sequencerBÐs+ô% T¬;¯?©?×+FÑ+FÔGŒDØðrcó–ddlm}|iS|i}n5t|t«r t ||«s t||«r
t |di«}|j
«Dcic]\}}|D]}||ŒŒ}}}}i}i}|j
«D]:\} }
|j| | «}||vrtd||d| d«| ||<|
||<Œ<|Scc}}}w)aA
Helper function to normalize kwarg inputs.
Parameters
----------
kw : dict or None
A dict of keyword arguments. None is explicitly supported and treated
as an empty dict, to support functions with an optional parameter of
the form ``props=None``.
alias_mapping : dict or Artist subclass or Artist instance, optional
A mapping between a canonical name to a list of aliases, in order of
precedence from lowest to highest.
If the canonical value is not in the list it is assumed to have the
highest priority.
If an Artist subclass or instance is passed, use its properties alias
mapping.
Raises
------
TypeError
To match what Python raises if invalid arguments/keyword arguments are
passed to a callable.
r)ÚArtistÚ
_alias_mapz Got both z and z", which are aliases of one another) Úmatplotlib.artistrDrRrÚ
issubclassrârˆr/r[) ÚkwÚ
alias_mappingrDÚ canonicalÚ
alias_listÚaliasÚ to_canonicalÚcanonical_to_seenÚretrfrgs rÚnormalize_kwargsrPØsõ6 €z؈ ðÐØ
Ü
]¤DÔ
)¬j¸ÈÔ.OÜ
˜
 
 
¨|¸@ˆ
ð2?×1DÑ1DÓ1F÷-˜  :Ø!+òð˜9Ñ--€LòÐØ
€Cà
òˆˆ1Ø ×$ Q¨Ó*ˆ Ø Ð ˜iÐ(9¸)Ñ(DÐ'GÀuØ ˜eÐ#EðGóHð
Hà'(Иˆˆð
ð €Jùô-sÁCc#óªKt|«}|j|jdz«}d}d}t|«D]} |j d«5 ddd«ntdj|«« d|j«y#1swYnxYwŒ_#t
$rt
j|«YŒwxYw#|j«wxYw­w)af
Context manager for locking a path.
Usage::
with _lock_path(path):
...
Another thread or process that attempts to lock the same path will wait
until this context manager is exited.
The lock is implemented by creating a temporary file in the parent
directory, so that directory must exist and be writable.
z.matplotlib-lockrâgš™™™™™¹?ÚxbNzÛLock error: Matplotlib failed to acquire the following lock file:
{}
This maybe due to another process holding this lock file. If you are sure no
other Matplotlib process is running, remove this file and try again.) rÚ with_namerÚrangeròÚFileExistsErrorÚtimeÚsleepÚ TimeoutErrorÚformatÚunlink)rÚ lock_pathÚretriesÚ sleeptimeÚ_s rÚ
_lock_pathr_èø€ô ‹:€DؘtŸy™yÐ+=Ñ>€IØ€GØ€IÜ
7 ˆð Ó
Ø÷
ñ
ð ôðH÷IOÉØ óIó ð ð Û
à×ÑÕ÷
ð
úð
øäò J‰J  "ûð ×ÑÕüs^<C¿BÁB
ÁBÁCÁ8B>Á<CÂ
B ÂBÂCÂB;Â8CÂ:B;Â;CÂ>CÃCÚzorderr{có$|t|««S)a
Get the topmost artist of a list.
In case of a tie, return the *last* of the tied artists, as it will be
drawn on top of the others. `max` returns the first maximum in case of
ties, so we need to iterate over the list in reverse order.
)Úreversed)ÚartistsÚ _cached_maxs rÚ_topmost_artistre7sñ ”x Ó )rcó0t|t«xr||k(S)a
Return whether *obj* is a string equal to string *s*.
This helper solely exists to handle the case where *obj* is a numpy array,
because in such cases, a naive ``obj == s`` would yield an array, which
cannot be used in a boolean context.
)rR©rNs rÚ
_str_equalrhDsô cœ3Ó Ò , C¨1¡HÐ,rcóLt|t«xr|j«|k(S)a
Return whether *obj* is a string equal, when lowercased, to string *s*.
This helper solely exists to handle the case where *obj* is a numpy array,
because in such cases, a naive ``obj == s`` would yield an array, which
cannot be used in a boolean context.
)rRr
rgs rÚ_str_lower_equalrjOs!ô cœ3Ó Ò 4 C§I¡I£K°1Ñ$4Ð4rcó®tjdd}tjddd}tj|d|f||df|d|f||dff«S)aZ
Get the elements on the perimeter of *arr*.
Parameters
----------
arr : ndarray, shape (M, N)
The input array.
Returns
-------
ndarray, shape (2*(M - 1) + 2*(N - 1),)
The elements on the perimeter of the array::