HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyo
�
�)�Uc@s�dZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddljZddlmZddlZddlZddlZddlZddlZddlZej\ZZZZZ y(e	j!e"�j#�Z$e$sXdZ$nWn e&e'e(fk
r{dZ$nXd�Z)ddtd��YZ*de*fd	��YZ+d
e*fd��YZ,de*fd
��YZ-de*fd��YZ.de*fd��YZ/ddud��YZ0de
j1fd��YZ2de2fd��YZ3de2fd��YZ4de5fd��YZ6d�Z7ddvd��YZ8d�Z9d �Z:d!�Z;d"�Z<d#�Z=d$�Z>d%�Z?d&e"d'�Z@d(�ZAd)ejBfd*��YZCeDd+�ZEdeE_FeAd,�ZGd-dwd.��YZHd/eIfd0��YZJd1d2�ZKd3dxd4��YZLd5d6�ZMd7dyd8��YZNeN�ZOd9�ZPd:dzd;��YZQd<�ZRd=�ZSejTd>�ZUiZVd?�ZWd@dAdBdC�ZXdD�ZYdEdF�ZZddG�Z[dH�Z\dI�Z]dJ�Z^dK�Z_dLeIfdM��YZ`dNeafdO��YZbdP�Zce"dQ�ZddR�ZedBdS�ZfdTZgdU�ZhdV�ZidW�ZjdXd{dY��YZkejle"dZ�Zmd[eafd\��YZnd]�Zod^�Zpd_�ZqeDd`�Zrd|d}d~dgZseIes�ZtetjugesD]ZvevdAevdBf^q8�e"di�Zwdj�Zxdkddl�Zydm�Zzdn�Z{do�Z|dp�Z}dq�Z~dr�Ze�dskr�ndS(�su
A collection of utility functions and classes.  Many (but not all)
from the Python Cookbook -- hence the name cbook
i����(t
generatorsN(trefcCs'tdkrt|�St|t�SdS(N(tpreferredencodingtNonetunicode(ts((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytunicode_safe's
t	convertercBs/eZdZddd�Zd�Zd�ZRS(s[
    Base class for handling string -> python type with support for
    missing values
    tNullcCs||_||_dS(N(tmissingt
missingval(tselfR	R
((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt__init__1s	cCs||jkr|jS|S(N(R	R
(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt__call__4scCs|j�p||jkS(N(tstripR	(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt
is_missing8sN(t__name__t
__module__t__doc__RRR
R(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR,s	ttostrcBseZdZddd�ZRS(sconvert to string or NoneRtcCstj|d|d|�dS(NR	R
(RR(RR	R
((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR=s(RRRR(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR;st
todatetimecBs)eZdZdddd�Zd�ZRS(sconvert to a datetime or Nones%Y-%m-%dRcCs tj|||�||_dS(s8use a :func:`time.strptime` format string for conversionN(RRtfmt(RRR	R
((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRBscCs<|j|�r|jStj||j�}tj|d �S(Ni(RR
ttimetstrptimeRtdatetime(RRttup((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR
GsN(RRRRRR
(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR@sttodatecBs)eZdZdddd�Zd�ZRS(sconvert to a date or Nones%Y-%m-%dRcCs tj|||�||_dS(s8use a :func:`time.strptime` format string for conversionN(RRR(RRR	R
((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRPscCs<|j|�r|jStj||j�}tj|d �S(Ni(RR
RRRRtdate(RRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR
TsN(RRRRRR
(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRNsttofloatcBs&eZdZddd�Zd�ZRS(sconvert to a float or NoneRcCstj||�||_dS(N(RRR
(RR	R
((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR[scCs |j|�r|jSt|�S(N(RR
tfloat(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR
^sN(RRRRRR
(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRYsttointcBs&eZdZddd�Zd�ZRS(sconvert to an int or NoneRcCstj||�dS(N(RR(RR	R
((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRescCs |j|�r|jSt|�S(N(RR
tint(RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR
hsN(RRRRRR
(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRcstCallbackRegistrycBsQeZdZdefd��YZd�Zd�Zd�Zd�Zd�Z	RS(s]
    Handle registering and disconnecting for a set of signals and
    callbacks::

       signals = 'eat', 'drink', 'be merry'

       def oneat(x):
           print 'eat', x

       def ondrink(x):
           print 'drink', x

       callbacks = CallbackRegistry(signals)

       ideat = callbacks.connect('eat', oneat)
       iddrink = callbacks.connect('drink', ondrink)

       #tmp = callbacks.connect('drunk', ondrink) # this will raise a ValueError

       callbacks.process('drink', 123)    # will call oneat
       callbacks.process('eat', 456)      # will call ondrink
       callbacks.process('be merry', 456) # nothing will be called
       callbacks.disconnect(ideat)        # disconnect oneat
       callbacks.process('eat', 456)      # nothing will be called

    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.  The Python stdlib weakref module can not create weak
    references to bound methods directly, so we need to create a proxy
    object to handle weak references to bound methods (or regular free
    functions).  This technique was shared by Peter Parente on his
    `"Mindtrove" blog
    <http://mindtrove.info/articles/python-weak-references/>`_.
    tBoundMethodProxycBs2eZdZd�Zd�Zd�Zd�ZRS(s�
        Our own proxy object which enables weak references to bound and unbound
        methods and arbitrary callables. Pulls information about the function,
        class, and instance out of a bound method. Stores a weak reference to the
        instance to support garbage collection.

        @organization: IBM Corporation
        @copyright: Copyright (c) 2005, 2006 IBM Corporation
        @license: The BSD License

        Minor bugfixes by Michael Droettboom
        cCs�yOyt|j�|_Wntk
r5d|_nX|j|_|j|_Wn,t	k
r}d|_||_d|_nXdS(N(
Rtim_selftinstt	TypeErrorRtim_functfunctim_classtklasstAttributeError(Rtcb((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR�s


		cOss|jdk	r*|j�dkr*t�n<|jdk	r]tj|j|j�|j�}n	|j}|||�S(s�
            Proxy for a call to the weak referenced object. Take
            arbitrary params to pass to the callable.

            Raises `ReferenceError`: When the weak reference refers to
            a dead object
            N(R$RtReferenceErrortnewtinstancemethodR'R)(Rtargstkwargstmtd((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR
�s!	$	cCssyZ|jdkr1|j|jko0|jdkS|j|jkoX|j�|j�kSWntk
rntSXdS(sm
            Compare the held function and instance with that held by
            another proxy.
            N(R$RR't	ExceptiontFalse(Rtother((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt__eq__�s,
cCs|j|�S(s,
            Inverse of __eq__.
            (R5(RR4((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt__ne__�s(RRRRR
R5R6(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR"�s
	
		
cCsGt|�|_tg|D]}|t�f^q�|_d|_dS(s(*signals* is a sequence of valid signalsiN(tsettsignalstdictt	callbackst_cid(RR8R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR�s+cCsE||jkrAt|j�}|j�td||f��ndS(s5make sure *s* is a valid signal or raise a ValueErrors)Unknown signal "%s"; valid signals are %sN(R8tlisttsortt
ValueError(RRR8((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt
_check_signal�s
cCs�|j|�|j|�}xc|j|j�D]N\}}|jdk	rn|j�dkrn|j||=q0||kr0|Sq0W|jd7_||j||j<|jS(si
        register *func* to be called when a signal *s* is generated
        func will be called
        iN(R?R"R:titemsR$RR;(RRR'tproxytcidtcallback((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytconnect�s
 !cCsJxC|jj�D]2\}}y||=Wntk
r=qqXdSqWdS(sK
        disconnect the callback registered with callback id *cid*
        N(R:R@tKeyError(RRBt	eventnamet	callbackd((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt
disconnect�s
cOst|j|�x`|j|j�D]K\}}|jdk	r_|j�dkr_|j||=q!|||�q!WdS(s�
        process signal *s*.  All of the functions registered to receive
        callbacks on *s* will be called with *\*args* and *\*\*kwargs*
        N(R?R:R@R$R(RRR/R0RBRA((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytprocess�s

 !(
RRRtobjectR"RR?RDRHRI(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR!ls'@				t	SchedulercBs2eZdZej�ZdZd�Zd�ZRS(s4
    Base class for timeout and idle scheduling
    icCsGtjj|�tj|_t|_tjd7_tj�|_dS(Ni(	t	threadingtThreadRRKtidR3t_stoppedtEventt
_stopevent(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRs
	cCs1|jr
dS|jj�|j�t|_dS(N(RORQR7tjointTrue(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytstops
	

(	RRRRLtLocktidlelockRNRRT(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRKs
	tTimeoutcBs eZdZd�Zd�ZRS(s?
    Schedule recurring events with a wait time in seconds
    cCs#tj|�||_||_dS(N(RKRtwaitR'(RRXR'((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR$s
	cCs`xY|jj�s[|jj|j�tjj�|j|�}tjj�|sPqqWdS(N(RQtisSetRXRKRVtacquireR'trelease(Rtb((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytrun)s

(RRRRR](((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRW s	tIdlecBs&eZdZdZd�Zd�ZRS(s3
    Schedule callbacks when scheduler is idle
    g�������?cCstj|�||_dS(N(RKRR'(RR'((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR:s
cCs`xY|jj�s[|jjtj�tjj�|j|�}tjj	�|sPqqWdS(N(
RQRYRXR^twaittimeRKRVRZR'R[(RR\((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR]>s

(RRRR_RR](((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR^2s	tsilent_listcBs,eZdZdd�Zd�Zd�ZRS(s�
    override repr when returning a list of matplotlib artists to
    prevent long, meaningless output.  This is meant to be used for a
    homogeneous list of a give type
    cCs)||_|dk	r%|j|�ndS(N(ttypeRtextend(RRatseq((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRMs	cCsdt|�|jfS(Ns<a list of %d %s objects>(tlenRa(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt__repr__QscCsdt|�|jfS(Ns<a list of %d %s objects>(RdRa(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt__str__TsN(RRRRRReRf(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR`Gs	cCs:d}|d	d
!}x |D]}|j|d�}qW|S(
s%remove latex formatting from mathtexts\mathdefaults\rms\cals\tts\its\t{t}ii����R(s\mathdefaults\rms\cals\tts\its\RgRh(treplace(Rtremovetr((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt
strip_mathWs


tBunchcBs eZdZd�Zd�ZRS(s�
    Often we want to just collect a bunch of stuff together, naming each
    item of the bunch; a dictionary's OK for that, but a small do- nothing
    class is even handier, and prettier to use.  Whenever you want to
    group a few variables:

      >>> point = Bunch(datum=2, squared=4, coord=12)
      >>> point.datum

      By: Alex Martelli
      From: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52308
    cKs|jj|�dS(N(t__dict__tupdate(Rtkwds((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRkscCsD|jj�}ddjg|D]}d||j|f^q�S(Ns	Bunch(%s)s, s%s=%s(RntkeysRR(RRqtk((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyReos(RRRRRe(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRm^s	cCs)tg|D]}|df^q
�j�S(s'Return a list of unique elements of *x*i(R9Rq(txtval((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytuniquesscCsyt|�WntSXtS(s return true if *obj* is iterable(RdR3RS(tobj((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytiterablews
cCsot|ttf�rtStj|�rT|jdkrM|jjdkrMtSt	Sny|dWnt	SXtS(s(Return True if *obj* looks like a stringitSUR(
t
isinstancetstrRRStmat
isMaskedArraytndimtdtypetkindR3(Rv((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytis_string_like~s!cCsEt|�stSt|�r tSx|D]}t|�s'tSq'WtS(s@
    Returns true if *obj* is iterable and contains strings
    (RwR3R�RS(Rvto((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytis_sequence_of_strings�s
cCst|d�ot|j�S(sCreturn true if *obj* looks like a file object with a *write* methodtwrite(thasattrtcallableR�(Rv((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytis_writable_file_like�scCst|�ot|�S(s;return true if *obj* is not string like and is not iterable(R�Rw(Rv((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt	is_scalar�scCsy|dWntSXtSdS(s(return true if *obj* looks like a numberiN(R3RS(Rv((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt
is_numlike�s
trUcCs�t|�r�|jd�rNddl}|jdd�}|j||�}nQ|jd�r�|jdd�}ddl}|j||�}nt||�}t}n*t	|d�r�|}t
}ntd��|r�||fS|S(	s�
    *fname* can be a filename or a file handle.  Support for gzipped
    files is automatic, if the filename ends in .gz.  *flag* is a
    read/write flag for :func:`file`
    s.gzi����NtURs.bz2tseeks%fname must be a string or file handle(R�tendswithtgzipRitopentbz2tBZ2FiletfileRSR�R3R>(tfnametflagt
return_openedR�tfhR�topened((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt
to_filehandle�s$		
cCst|�pt|�S(N(R�Rw(Rt((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytis_scalar_or_string�stViewVCCachedServercBskeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zed
�Z
RS(s�
    Urllib2 handler that takes care of caching files.
    The file cache.pck holds the directory of files that have been cached.
    cCs<||_||_|j�|j�tj|�|_dS(N(t	cache_dirtbaseurlt
read_cachetremove_stale_filesturllib2tbuild_openertopener(RR�R�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR�s
		

cCsetjj|�\}}tjj|j|�}tjj|�sRtj|�ntjj||�S(N(tostpathtsplitRRR�texiststmakedirs(Rtfntreldirtfilenametdatadir((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytin_cache_dir�s
cCs�|jd�}tjj|�s.i|_dSt|d�}tj|�}|j�xT|j	�D]F\}\}}}tjj
|�sc|j|�||f||<qcqcWx?|j	�D]1\}\}}}tjj|�s�||=q�q�W||_dS(s?
        Read the cache file from the cache directory.
        s	cache.pckNtrb(R�R�R�R�tcacheR�tcPickletloadtcloseR@tisabs(RR�tfR�turlRstyt_((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR��s	
"#"cCs�td�|jj�D��}ttjd�tj|j�D��}tj	j
d|d�tj	j
d|d�xO||t|jd�g�D]-}tj	j
d|dd�tj|�q�Wd	S(
sa
        Remove files from the cache directory that are not listed in
        cache.pck.
        css$|]\}\}}}|VqdS(N((t.0R�R�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pys	<genexpr>�sc3s4|]*\�}}t�fd�|D��VqdS(c3s$|]}tjj�|�VqdS(N(R�R�RR(R�R�(tdirpath(sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pys	<genexpr>�sN(R7(R�R�t	filenames((R�sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pys	<genexpr>�ss1ViewVCCachedServer: files listed in cache.pck: %stdebugs0ViewVCCachedServer: files in cache directory: %ss	cache.pcks2ViewVCCachedServer:remove_stale_files: removing %stlevelN(
R7R�R@treducetunionR�twalkR�t
matplotlibtverbosetreportR�Rj(RtlistedtexistingR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR��s			'cCsB|jd�}t|d�}tj|j|d�|j�dS(sJ
        Write the cache data structure into the cache directory.
        s	cache.pcktwbi����N(R�R�R�tdumpR�R�(RR�R�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytwrite_cachescCs~|t|j�}|j|�}t|d�}|j|�|j�||jd�|jd�f|j|<|j�dS(s?
        Store a received file in the cache directory.
        R�tETags
Last-ModifiedN(	RdR�R�R�R�R�tgetR�R�(RR�tdatatheadersR�tfullpathR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt
cache_files

(cCsX|j�}||jkrT|j|\}}}|jd|�|jd|�n|S(sH
        Make the request conditional if we have a cached file.
        s
If-None-MatchsIf-Modified-Since(tget_full_urlR�t
add_header(RtreqR�R�tetagtlastmod((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pythttp_request#scCsj|j�}|j|\}}}tjjd|d�t|d�}	tj|	||�}
d|
_|
S(sU
        Read the file from the cache since the server has no newer version.
        s:ViewVCCachedServer: reading data file from cache file "%s"R�R�i0(	R�R�R�R�R�R�R�t
addinfourltcode(RR�tfpR�tmsgthdrsR�R�R�R�thandle((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pythttp_error_304.s	cCs�tjjd|j|jfd�|jdkr6|S|j�}|j|j�||j�t	j
tj|�|j|j��}|j|_|j|_|SdS(s:
        Update the cache with the returned file.
        s,ViewVCCachedServer: received response %d: %sR�i�N(R�R�R�R�R�treadR�R�R�R�R�tStringIO(RR�tresponseR�tresult((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt
http_response;scCs4ttdd�}|dkr6ddl}|j}n|j||�}d}tjjd|d�y|j	j
|�}Wn"tjk
r�}t|�}nX|j
j|�}	|	dkr�d||f}
t|
��n|	d}|r,tjj|�dj�dkrd}nd
}t
||�S|SdS(s.
        Check the cachedirectory for a sample_data file.  If it does
        not exist, fetch it with urllib from the svn repo and
        store it in the cachedir.

        If asfileobj is True, a file object will be returned.  Else the
        path to the file as a string will be returned.
        tquotei����Ns
unknown errors!ViewVCCachedServer: retrieving %sR�s9file %s not in cache; received %s when trying to retrieveis.csvs.xrcs.txtRkR�(s.csvs.xrcs.txt(tgetattrR�RturllibR�R�R�R�R�R�R�tURLErrorRzR�R�RER�R�tsplitexttlower(RR�t	asfileobjR�R�R�terrorR�tetcachedR�tmode((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytget_sample_dataMs0

"	
(RRRRR�R�R�R�R�R�R�R�RSR�(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR��s										
	cCs�tjdsItjd}tjj||�}|rBt|d�S|Sntj}|dkr�tj	�}tjj|d�}d}t
||�}t_n|j|d|�S(s\
    Check the cachedirectory ~/.matplotlib/sample_data for a sample_data
    file.  If it does not exist, fetch it with urllib from the mpl svn repo

      http://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/sample_data/

    and store it in the cachedir.

    If asfileobj is True, a file object will be returned.  Else the
    path to the file as a string will be returned

    To add a datafile to this directory, you need to check out
    sample_data from matplotlib svn::

      svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/sample_data

    and svn add the data file you want to support.  This is primarily
    intended for use in mpl examples that need custom data.

    To bypass all downloading, set the rc parameter examples.download to False
    and examples.directory to the directory where we should look.
    sexamples.downloadsexamples.directoryR�tsample_datasKhttp://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/sample_data/R�N(R�trcParamsR�R�RRR�R�tmyserverRt
get_configdirR�(R�R�t	directoryR�R�t	configdirtcachedirR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR�}s


	ccsHxA|D]9}||�r!|Vqxt||�D]}|Vq1WqWdS(si
    this generator flattens nested containers such as

    >>> l=( ('John', 'Hunter'), (1,23), [[[[42,(5,23)]]]])

    so that

    >>> for i in flatten(l): print i,
    John Hunter 1 23 42 5 23

    By: Composite of Holger Krekel and Luther Blissett
    From: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/121294
    and Recipe 1.12 in cookbook
    N(tflatten(Rctscalarptitemtsubitem((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR��s

tSortercBs>eZdZd�Zddd�Zdd�ZeZeZRS(sf

    Sort by attribute or item

    Example usage::

      sort = Sorter()

      list = [(1, 2), (4, 8), (0, 3)]
      dict = [{'a': 3, 'b': 4}, {'a': 5, 'b': 2}, {'a': 0, 'b': 0},
              {'a': 9, 'b': 9}]


      sort(list)       # default sort
      sort(list, 1)    # sort by index 1
      sort(dict, 'a')  # sort a list of dicts by key 'a'

    cCsA|j�g|D]\}}||^q}|r=||(n|S(N(R=(RR�tauxtinplacetjunktiR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt_helper�s

#
icCs�|dkr:|r%|j�|}n|}|j�|Sgtt|��D]}||||f^qM}|j|||�SdS(N(RR=trangeRdR�(RR�t	itemindexR�R�R�R�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytbyItem�s
	
3cCsKgtt|��D]}t|||�|f^q}|j|||�S(N(R�RdR�R�(RR�t
attributenameR�R�R�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytbyAttribute�s8N(	RRRR�RR�R�R=R
(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR��s	
tXlatorcBs)eZdZd�Zd�Zd�ZRS(sm
    All-in-one multiple-string-substitution class

    Example usage::

      text = "Larry Wall is the creator of Perl"
      adict = {
      "Larry Wall" : "Guido van Rossum",
      "creator" : "Benevolent Dictator for Life",
      "Perl" : "Python",
      }

      print multiple_replace(adict, text)

      xlat = Xlator(adict)
      print xlat.xlat(text)
    cCs(tjdjttj|j����S(s= Build re object based on the keys of the current dictionary t|(tretcompileRRtmaptescapeRq(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt_make_regexscCs||jd�S(s( Handler invoked for each regex *match* i(tgroup(Rtmatch((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR
scCs|j�j||�S(s. Translate *text*, returns the modified text. (Rtsub(Rttext((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytxlats(RRRRR
R
(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR��s		icCs�d}d}d}xp|j�D]b}|j�r|s@|}n|t|�td�}|sq||dkr�||7}q�qqW||d}|jdd�}||d| S(s6 soundex module conforming to Odell-Russell algorithm t01230120022455012623010202RtAi����it0(tuppertisalphatordRi(tnameRdtsoundex_digitstsndxtfctctd((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytsoundexs	RcBsVeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	s0 Null objects always and reliably "do nothing." cOsdS(N((RR/R0((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR1scOs|S(N((RR/R0((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR
2scCsdS(NsNull()((R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRf3scCsdS(NsNull()((R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRe4scCsdS(Ni((R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt__nonzero__5scCs|S(N((RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt__getattr__7scCs|S(N((RRtvalue((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt__setattr__8scCs|S(N((RR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt__delattr__9s(RRRRR
RfReRRRR(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR.s							i�cCs�y�tjj|�s�tjj|�}x_tdt|�d�D]A}tjj|| �}tjj|�sAtj||�qAqAWnWn>tk
r�}|j	t	j
ks�tjj|�r��q�nXdS(s�
    make directory *newdir* recursively, and set *mode*.  Equivalent to ::

        > mkdir -p NEWDIR
        > chmod MODE NEWDIR
    iN(R�R�R�R�R�RdRRR�tOSErrorterrnotEEXISTtisdir(tnewdirR�tpartsR�tthispartterr((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytmkdirs>s %tGetRealpathAndStatcBseZd�Zd�ZRS(cCs
i|_dS(N(t_cache(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRTscCs�|jj|�}|dkr�tjj|�}tjdkrH|}n!tj|�}|j	|j
f}||f}||j|<n|S(Ntwin32(R'R�RR�R�trealpathtsystplatformtstattst_inotst_dev(RR�R�R)tstat_keyR,((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR
Ws	(RRRR
(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR&Ss	cCs4x-|D]%}y||=Wqtk
r+qXqWdS(s3delete all of the *keys* from the :class:`dict` *d*N(RE(RRqtkey((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytdict_delalles


t
RingBuffercBsEeZdZd�Zddd��YZd�Zd�Zd�ZRS(s- class that implements a not-yet-full buffer cCs||_g|_dS(N(tmaxR�(Rtsize_max((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRns	t__FullcBs eZdZd�Zd�ZRS(s% class that implements a full buffer cCs+||j|j<|jd|j|_dS(s/ Append an element overwriting the oldest one. iN(R�tcurR3(RRs((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytappendtscCs|j|j|j|j S(s* return list of elements in correct order (R�R6(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR�xs(RRRR7R�(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR5rs	cCsA|jj|�t|j�|jkr=d|_t|_ndS(s*append an element at the end of the bufferiN(R�R7RdR3R6t_RingBuffer__Fullt	__class__(RRs((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR7|s	cCs|jS(s: Return a list of elements from the oldest to the newest. (R�(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR��scCs|j|t|j�S(N(R�Rd(RR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt__get_item__�s((RRRRR8R7R�R:(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR2ls	
		cCs`d}xMt|tt|���D]0\}}|t|�d7}||kr"|Sq"Wt|�S(so
    *seq* is a list of words.  Return the index into seq such that::

        len(' '.join(seq[:ind])<=N

    ii(tzipR�Rd(RctNtsLentwordtind((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt
get_split_ind�s(cCs�dt|j��}|t|�}|jd�}t|�}d}g}xA||kr�|}	|t|||�7}|j||	|!�qPW|dj|d�d}
x-|dD]!}|
|dj|�d7}
q�W|
S(s*wrap *text* with *prefix* at length *cols*t is
i(Rdt
expandtabsR�R@R7RR(tprefixR	tcolstpadt	availableRctNseqR?tlinestlastIndtrettline((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytwrap�ss(?:(?:

?)|^)( *)\ScCs�|s
dStj|�}|dkr)|S|jd�|jd�}|dkrU|Stj|d�}|dkr�tjd|�}|t|<n|j	d|�j
�}|S(s�
    Remove excess indentation from docstring *s*.

    Discards any leading blank lines, then removes up to n whitespace
    characters from each line, where n is the number of leading
    whitespace characters in the first line. It differs from
    textwrap.dedent in its deletion of leading blank lines and its use
    of the first non-blank line to determine the indentation.

    It is also faster in most cases.
    Riis


? {0,%d}s
N(t_find_dedent_regexRRtendtstartt
_dedent_regexR�RRRR(RRtnshifttunindentR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytdedent�s
t*iic	s�ddl�ddl�|jd�}ddd��Y}|d|d|d|d	g�}��fd
�}�jj|||�|jS(sU
    Recursively list files

    from Parmar and Martelli in the Python Cookbook
    i����Nt;RmcBseZd�ZRS(c[s|jj|�dS(N(RnRo(RRp((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR�s(RRR(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRm�strecursetpattern_listtreturn_folderstresultscs�x�|D]}�jj�jj||��}|jsI�jj|�rx:|jD],}�j||�rS|jj|�PqSqSWqqW|j	s�g|(ndS(N(
R�tnormpathRRRXtisfileRWtfnmatchRYR7RV(targtdirnametfilesRtfullnametpattern(R\R�(sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytvisit�s
!	((tos.pathR\R�R�R�RY(troottpatternsRVRXRWRmR]Rb((R\R�sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt	listFiles�scCs�g}xm|D]e}tjj|�r8|j|�q
ntjj|�r
t|dddd�}|j|�q
q
Wg|D]}tjj|�s}|^q}S(sx
    Recurse all the files and dirs in *args* ignoring symbolic links
    and return the files as a list of strings
    RViRX(R�R�R[R7R RfRbtislink(R/R_R]tnewfilesR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytget_recursive_filelist�s

iccs@d}x3||||!}t|�s*Pn|V||7}q	dS(s$Break up the *seq* into *num* tuplesiN(Rd(RctnumROR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytpiecesscCs?tj�}|dk	r%||IJntjd|�|j�S(NR�(R�Rt	tracebackt	print_exctgetvalue(Rtsh((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytexception_to_strs

cCs^t|�dkrtS|d}x7tdt|��D] }||}||kr6tSq6WtS(sm
    Return *True* if all elements of *seq* compare equal.  If *seq* is
    0 or 1 length, return *True*
    iii(RdRStxrangeR3(RcRtR�tthisval((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytallequal"s

cCs/t|�stSx|D]}|stSqWtS(sl
    Return *True* if all elements of *seq* evaluate to *True*.  If
    *seq* is empty, return *False*.
    (RdR3RS(RcRt((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytalltrue.s
cCs/t|�stSx|D]}|rtSqWtS(sb
    Return *True* if one element of *seq* is *True*.  It *seq* is
    empty, return *False*.
    (RdR3RS(RcRt((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytonetrue8s
cCs>gt|�D]-\}}||dD]}||f^q%q
S(s
    return all possible pairs in sequence *x*

    Condensed by Alex Martelli from this thread_ on c.l.python

    .. _thread: http://groups.google.com/groups?q=all+pairs+group:*python*&hl=en&lr=&ie=UTF-8&selm=mailman.4028.1096403649.5135.python-list%40python.org&rnum=1
    i(t	enumerate(RsR�R�R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytallpairsBstmaxdictcBs eZdZd�Zd�ZRS(s�
    A dictionary with a maximum size; this doesn't override all the
    relevant methods to contrain size, just setitem, so use with
    caution
    cCs#tj|�||_g|_dS(N(R9Rtmaxsizet	_killkeys(RRy((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRTs
	cCsf||krOt|�|jkr<||jd=|jd=n|jj|�ntj|||�dS(Ni(RdRyRzR7R9t__setitem__(RRrtv((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR{Xs
(RRRRR{(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRxNs	tStackcBs}eZdZd
d�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�ZRS(s�
    Implement a stack where elements can be pushed on and you can move
    back and forth.  But no pop.  Should mimic home / back / forward
    in a browser
    cCs|j�||_dS(N(tcleart_default(Rtdefault((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRis
cCs(t|j�s|jS|j|jSdS(s#return the current element, or NoneN(Rdt	_elementsRt_pos(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR
mscCs
|jj�S(N(R�t__len__(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR�rscCs|jj|�S(N(R�t__getitem__(RR?((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR�uscCs;t|j�}|j|dkr4|jd7_n|�S(s8move the position forward and return the current elementi(RdR�R�(RR<((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytforwardxscCs(|jdkr!|jd8_n|�S(s5move the position back and return the current elementii(R�(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytback~scCsD|j|jd |_|jj|�t|j�d|_|�S(s�
        push object onto stack at current position - all elements
        occurring later than the current position are discarded
        i(R�R�R7Rd(RR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytpush�scCs.t|j�sdS|j|jd�|�S(s0push the first element onto the top of the stackNi(RdR�R�(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pythome�scCst|j�dkS(Ni(RdR�(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytempty�scCsd|_g|_dS(sempty the stacki����N(R�R�(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR~�s	cCs�||jkrtd��n|j}|j�g}x7|D]/}||kra|j|�q?|j|�q?Wx|D]}|j|�qyW|S(se
        raise *o* to the top of the stack and return *o*.  *o* must be
        in the stack
        sUnknown element o(R�R>R~R7R�(RR�toldtbubblestthiso((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytbubble�s



cCsf||jkrtd��n|j}|j�x-|D]%}||krQq9q9|j|�q9WdS(s!remove element *o* from the stacksUnknown element oN(R�R>R~R�(RR�R�R�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRj�s


N(RRRRRR
R�R�R�R�R�R�R�R~R�Rj(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR}bs						
				cCs+x$tt|��D]}|j�qWdS(sempty a listN(RqRdtpop(RcR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytpopall�scCs�|r:gt|�D]}t|�r||f^q}nCgt|�D]$}t|�rG|j�|f^qG}|j�}g|D]'\}}|j|�dkr�|^q�S(su
    return all attributes of *o* which match string in match.  if case
    is True require an exact case match.
    i(tdirR�R�tfind(R�RtcaseRtnamestorig((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytfinddir�s
47cCs/tg|j�D]\}}||f^q�S(sAreverse the dictionary -- may lose data if values are not unique!(R9R@(RRrR|((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytreverse_dict�scCsddlm}m}tj�}tjdkro|d|dtd|�jj	�}t
|dj��}n�tjjd�r�|d|dtd|�jj	�}t
|d	j
�d	�}nTtjjd
�r|d|dtd|�jj	�}t
|d	j
�d�}n|S(
s%return the memory consumed by processi����(tPopentPIPEtsunos5sps -p %d -o osztshelltstdouttlinuxsps -p %d -o rss,szitdarwinsps -p %d -o rss,vszi(t
subprocessR�R�R�tgetpidR*R+RSR�t	readlinesR Rt
startswithR�(R�R�R�tpidta2tmem((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt
report_memory�ss0In safezip, len(args[0])=%d but len(args[%d])=%dcGsst|d�}xVt|d�D]D\}}t|�|kr!tt||dt|�f��q!q!Wt|�S(s-make sure *args* are equal len before zippingii(RdRvR>t_safezip_msgR;(R/tNxR�R]((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytsafezip�s
*cCs*yt||�SWntk
r%tSXdS(s;return issubclass(x, klass) and return False on a TypeErrorN(t
issubclassR%R3(RsR)((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytissubclass_safe�s
cCsNtj|�}y&tjj|dt�}|j�Wntk
rI|SX|S(Ntcopy(tnpt
asanyarrayR{tmasked_invalidR3tshrink_maskR%(Rstxm((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytsafe_masked_invalid�s
t
MemoryMonitorcBsSeZdd�Zd�Zd�Zdd�Zddd�Zddd
d	�ZRS(i NcCs5||_tj|jftj�|_|j�dS(N(t_nmaxR�tzerostint32t_memR~(Rtnmax((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR�s	cCsd|_t|_dS(Ni(t_nR3t	_overflow(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR~�s	cCsJt�}|j|jkr=||j|j<|jd7_n	t|_|S(Ni(R�R�R�R�RSR�(RR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR
s		icCs
|j}t||�}t||�}td||�}|d|d<HdGHdG|jdGHx�tdt|��D]�}||||d}|dkr�qtn|j|||j||d}d|||j||||t|�fGHqtW|jr	dGHndS(Niii����s(memory report: i, mem, dmem, dmem/nloopss%5d %5d %3d %8.3fs:Warning: array size was too small for the number of calls.(R�tminR R�R�RdRR�(RtsegmentstntdntiiR�tditdm((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR�s"	$	iicCs5tj||j|�}||j||j|�fS(N(R�tarangeR�R�(Rti0tisubRs((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytxyscCsg|dkr.ddlm}m}|�}n|jd�}|j|j||��|jj�dS(Ni����(tfiguretshowio(	RtpylabR�R�tadd_subplottplotR�tcanvastdraw(RR�R�tfigR�R�tax((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR�#sN(	RRRR~R
R�R�RR�(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR��s			cs�ddl�ddlm��fd���������fd��x5�D]-}�jd|f��||ig�qSWdS(sY
    *objects*
        A list of objects to find cycles in.  It is often useful to
        pass in gc.garbage to find the cycles that are preventing some
        objects from being garbage collected.

    *outstream*
        The stream for output.

    *show_progress*
        If True, print the number of objects reached as they are found.
    i����N(t	FrameTypecsKx7t|�D])\}}||dt|�}�jdtt|���t|t�r�x�|j�D]Z\}}||kr��jdt|��Pn||krj�jdt|��PqjqjWn^t|t	�r��jd|j
|��n2t|t�r�jd�n�jt|���jd�q
W�jd�dS(	Nis	   %s -- s[%s]s
[key] = %ss[%d]s	( tuple )s ->
s
(RvRdR�RzRaRyR9R@treprR<tindexttuple(R�R�tsteptnextR0Rt(t	outstream(sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt
print_path=s$cs��r �jdt|��nd|t|�<�j|�}xw|D]o}||kre�|�qF|�ksFt|��r�qFqFt|�|krF�|||||g�qFqFWdS(Ns%d
(R�RdRRNt
get_referentsRy(RvROtalltcurrent_patht	referentstreferent(R�tgctobjectsR�R�RVt
show_progress(sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRVTs

sExamining: %r
(R�ttypesR�R�(R�R�R�Rv((R�R�R�R�R�RVR�sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytprint_cycles-s
!
tGroupercBsPeZdZgd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(sf
    This class provides a lightweight way to group arbitrary objects
    together into disjoint sets when a full-blown graph data structure
    would be overkill.

    Objects can be joined using :meth:`join`, tested for connectedness
    using :meth:`joined`, and all disjoint sets can be retreived by
    using the object as an iterator.

    The objects being joined must be hashable and weak-referenceable.

    For example:

    >>> 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']
    >>> g = Grouper()
    >>> g.join(a, b)
    >>> g.join(b, c)
    >>> g.join(d, e)
    >>> list(g)
    [[d, e], [a, b, c]]
    >>> g.joined(a, b)
    True
    >>> g.joined(a, c)
    True
    >>> g.joined(a, d)
    False
    cCs;i}|_x'|D]}t|�g|t|�<qWdS(N(t_mappingR(RtinittmappingRs((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR�s

cCst|�|jkS(N(RR�(RR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt__contains__�scCsP|j}x@|j�D]2\}}|�dkr||=|j|�qqWdS(s@
        Clean dead weak references from the dictionary
        N(R�R@RRj(RR�R0Rt((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytclean�s
	cGs�|j}|jt|�t|�g�}x�|D]�}|jt|��}|dkr~|jt|��||t|�<q1||k	r1t|�t|�kr�||}}n|j|�x|D]}|||<q�Wq1q1W|j�dS(sa
        Join given arguments into the same set.  Accepts one or more
        arguments.
        N(	R�t
setdefaultRR�RR7RdRbR�(RtaR/R�tset_aR]tset_btelem((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyRR�s	!


cCsN|j�|j}y"|t|�|t|�kSWntk
rItSXdS(sJ
        Returns True if *a* and *b* are members of the same set.
        N(R�R�RRER3(RR�R\R�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytjoined�s
	"
ccs�|j�ddd��Y}|�}xR|jj�D]A}|d|k	r6g|D]}|�^qSV|j|�q6q6Wx1|jj�D] }|d|kr�|d=q�q�WdS(s�
        Iterate over each of the disjoint sets as a list.

        The iterator is invalid if interleaved with calls to join().
        tTokencBseZRS((RR(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR��si����N((R�R�t
itervaluesR7(RR�ttokenRRs((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt__iter__�s
	cCsH|j�|jjt|�t|�g�}g|D]}|�^q5S(sM
        Returns all of the items joined with *a*, including itself.
        (R�R�R�R(RR�tsiblingsRs((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytget_siblings�s
$(
RRRRR�R�RRR�R�R�(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR�os!		
			c	Cs�|dkr|Stj|�}t|�d|d}t|j�}||d<tj||j�}|d|d<|dd!}|d}|||}x8tdt|��D]!}|||||d|�<q�W|||d|�<|S(Niii����(	R�tfloorRdR<tshapeR�R~R�R (	R�tstepst
new_lengtht	new_shapeR�ta0ta1tdeltaR�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytsimple_linear_interpolation�s


cCs�tjj|�r�x�tjtjj|d��tjtjj|d��D]?}tjj|�rt|�tj|�qMtj|�qMWn
tj|�dS(NRTs.*(R�R�R tglobRRtrecursive_removet
removedirsRj(R�R�((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR��sA
c
Gs�t|�sdSt|d�s1t|d�r@td��nt|d�}g}tgt|�}x�t|�D]�\}}t|�r�t|�r�t|�|kr�t||<tj|�r�|j	dkr�td��q�q�t
j|�}n|j|�qvWg}x�t|�D]�\}}||r|j	dkrHqntj|�rz|jtj
|��|j}n|}y5t
j|�}t|t
j�r�|j|�nWq�q�XqqWt|�rOtt
j|�}|j�d}	t|	�|krOxCt|�D]2\}}||r|j|	dd�||<qqWqOnxFt|�D]8\}}||r\tj|�r\|j�||<q\q\W|S(sn
    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 :meth:`np.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().

    is!First argument must be a sequenceisMasked arrays must be 1-Dtaxis((RdR�RwR>R3RvRSR{tisMAR}R�tasarrayR7tgetmaskarrayR�tisfiniteRytndarrayR�tlogical_andtnonzerottaketfilled(
R/tnrecstmargstseqlistR�Rstmaskstxdtmasktigood((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytdelete_masked_pointssR !+


&cCsW|j|j�}tjd|df�}tjt|�d�}|d|d }tj|dk|�}tj|dk|�}t|�dkr�dS|s�tj|dd�tjf|dd�tjffdd�S||}tj	|�}tjd|d f�}	|}
tj|	dd�tjf|
dd�tjffdd�S(	s
    Find index ranges where *mask* is *False*.

    *mask* will be flattened if it is not already 1-D.

    Returns Nx2 :class:`numpy.ndarray` with each row the start and stop
    indices for slices of the compressed :class:`numpy.ndarray`
    corresponding to each of *N* uninterrupted runs of unmasked
    values.  If optional argument *compressed* is *False*, it returns
    the start and stop indices into the original :class:`numpy.ndarray`,
    not the compressed :class:`numpy.ndarray`.  Returns *None* if there
    are no unmasked values.

    Example::

      y = ma.array(np.arange(5), mask = [0,0,1,0,0])
      ii = unmasked_index_ranges(ma.getmaskarray(y))
      # returns array [[0,2,] [2,4,]]

      y.compressed()[ii[1,0]:ii[1,1]]
      # returns array [3,4,]

      ii = unmasked_index_ranges(ma.getmaskarray(y), compressed=False)
      # returns array [[0, 2], [3, 5]]

      y.filled()[ii[1,0]:ii[1,1]]
      # returns array [3,4,]

    Prior to the transforms refactoring, this was used to support
    masked arrays in Line2D.

    ii����iNR�(i(i(i(
treshapetsizeR�tconcatenateR�RdtcompressRtnewaxistcumsum(R
t
compressedtmtindicestmdifR�ti1t
seglengthstbreakpointstic0tic1((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytunmasked_index_rangesSs!?
t-tsolids--tdasheds-.tdashdott:tdottedcCs8tjdt�ddlj}|j|||d|�S(s\
    This function has been moved to matplotlib.mlab -- please import
    it from there
    saless_simple_linear_interpolation has been moved to matplotlib.mlab -- please import it from therei����Ntextrap(twarningstwarntDeprecationWarningtmatplotlib.mlabtmlabt less_simple_linear_interpolation(RsR�txiR&R+((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR,�scCs8tjdt�ddlj}|jtttdt	�S(s\
    This function has been moved to matplotlib.mlab -- please import
    it from there
    sIisvector has been moved to matplotlib.mlab -- please import it from therei����NR&(
R'R(R)R*R+tisvectorRsR�R-R&(tXR+((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR.�sg@cCs8tjdt�ddlj}|j|ddd|�S(s\
    This function has been moved to matplotlib.mlab -- please import
    it from there
    sOvector_lengths has been moved to matplotlib.mlab -- please import it from therei����NtPg@R�(R'R(R)R*R+tvector_lengths(R/R0R�R+((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR1�scCs,tjdt�ddlj}|j|�S(s\
    This function has been moved to matplotlib.mlab -- please import
    it from there
    sVdistances_along_curve has been moved to matplotlib.mlab -- please import it from therei����N(R'R(R)R*R+tdistances_along_curve(R/R+((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR2�scCs,tjdt�ddlj}|j|�S(s\
    This function has been moved to matplotlib.mlab -- please import
    it from there
    sLpath_length has been moved to matplotlib.mlab -- please import it from therei����N(R'R(R)R*R+tpath_length(R/R+((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR3�scCs,tjdt�ddlj}|j|�S(s\
    This function has been moved to matplotlib.mlab -- please import
    it from there
    sRis_closed_polygon has been moved to matplotlib.mlab -- please import it from therei����N(R'R(R)R*R+tis_closed_polygon(R/R+((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR4�scCs;tjdt�ddlj}|j||||||�S(s\
    This function has been moved to matplotlib.mlab -- please import
    it from there
    sKquad2cubic has been moved to matplotlib.mlab -- please import it from therei����N(R'R(R)R*R+t
quad2cubic(tq0xtq0ytq1xtq1ytq2xtq2yR+((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR5�sc's�dd�fd��Y}g|D]}||�^q }t}}xbtdg|D]}|j^qR�}|r�t|�}|g|D]}||�^q�fVqEPqEdS(s�
    This generator takes a bunch of iterables that are ordered by func
    It sends out ordered tuples:

      (func(row), [rows from all iterators matching func(row)])

    It is used by :func:`matplotlib.mlab.recs_join` to join record arrays
    tmyitercs)eZd�Z�fd�Zd�ZRS(cSs'||_d|_|_|j�dS(N(titRR0Rtiternext(RR=((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR�s	csPy(|jj�|_�|j�|_Wn!tk
rKd|_|_nXdS(N(R=R�RR0t
StopIterationR(R(R'(sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR>�s

cSsSd}||jkr+|j}|j�n$|jrO||jkrOtd�n|S(NsIterator has been left behind(RR0RR>R>(RR0tretval((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR
�s	
(RRRR>R
((R'(sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyR<�s	N((RStfilterRR0R�(R't	iterablesR<R=titerstminvalstminkey((R'sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytalign_iterators�s	
%'cCsHt|�}|jd�|jd�}|dkoA|ddk}|S(Nt$s\$ii(Rtcount(Rtdollar_countteven_dollars((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pytis_math_text�st__main__(((((((((R R!(s--R"(s-.R#(R$R%(�Rt
__future__RRR�RR*R�RltlocaleRLR�RRR'tnumpyR�tnumpy.maR{tweakrefRR�RctrandomR�R-R�tversion_infotmajortminor1tminor2RttmptgetpreferredencodingR3RRRR>tImportErrorR*RRRRRRRR!RMRKRWR^R<R`RlRmRuRwR�R�R�R�R�R�R�tBaseHandlerR�RSR�R�R�R�R9R�RRR%R&tget_realpath_and_statR1R2R@RLRRMRPRSRfRiRkRpRsRtRuRwRxRJR}R�R�R�R�R�R�R�R�R�R�R�R�R�R�RRt_linestylest	ls_mapperRotlsR,R.R1R2R3R4R5RFRKR(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cbook.pyt<module>s�l

	
	�				
	
				�)	3!		!			(				
	
	U						4Bw			L3	.
	

	
	
	
	
	*