a
    ëÝEbåº  ã                1  @   sš  d Z ddlZddlmZmZ ddlmZ ddlZddlZddl	Z	ddl
ZddlmZmZ ddlmZ ddlmZmZ ddlmZ dd	lmZmZ dd
lmZmZ g d¢Zg d¢Zee ZG dd„ dƒZeƒ dŸdddœdd„ƒZ dd„ Z!e e!ƒZ"dd„ Z#dd„ Z$dd„ Z%dd„ Z&ddœdd„Z'e'e(ƒZ)e'e(d d�Z*e e)d!d"�Z+e'e,ƒZ-e'e,d d�Z.e'e/ƒZ0e'e/d d�Z1e e0d#d"�Z2d$d%„ Z3d&d'„ Z4ed(ed d)�Z5e6ƒ Z7d*d+„ Z8d,d-„ Z9d.d/„ Z:d0d1„ Z;d2d3„ Z<d4d5„ Z=d6d7„ Z>e e>d d8d9�Z?d:d;„ Z@d<d=„ ZAd>d?„ ZBd@dA„ ZCe eCƒZDdBdC„ ZEdDdE„ ZFdFdG„ ZGdHdI„ ZHdJdK„ ZIedLg e J¡ ¢e K¡ ¢dM‘dN‘dO‘dP‘d d)�ZLdQdR„ ZMedSg dT¢ƒZNe eNƒZOdUdV„ ZPe ePƒZQdWdX„ ZRdYdZ„ ZSd[d\„ ZTd]d^„ ZUeTeUd_œZVd`da„ ZWe eWƒZXe e2ƒZYe e<d db�e2e eMƒe?e?e eƒe eƒeOe?e2e2e?eQe2e+eXeYdcœZZdddedLdfdgdhdidjdkdlœ	Z[dmdn„ ZG dodp„ dpej\ƒZ]dqdr„ Z^dsdt„ Z_G dudv„ dve`ƒZadwdx„ Zbe8e$e9e$e)e-e)e$e-e0eMe>e)e;e;e0e0e$eeeee2e2e2e$eNg dy¢e$e0e>e$e>e$e>e0e_e$e$eHe.e$e$e$e$e$e$e>e)e;e>e0e0eMe0e>e0eMe>e0eMe>e0eMe>e0eMe>e)e>e>e0eMe0e+e)e)e)eEe0e+e+e+e+e+e>e$e)g dz¢e-e-e$eFeFeFeFeFeFg d{¢g d|¢eGeAe)e@e-d}d~ge$e$eMe$e1e0g d¢g d€¢e%e>e>e0e$e$e$e$eCg d¢eEe;e1e0e$g d�¢g d‚¢eCe0eEe>e e-dƒd„�e$e$e-e$e-e$e^d…d†geVd‡ eVd‡ eVd‡ e$e$e)e)e#e)e)e)e)e)e)e)dˆd‰ge$e$eag dŠ¢ƒe-e-eCeBe=e0e$e$e1e0e0e0e0e0e0e0e:e:e$e$e$e$e0e0e0e0e0e0e>e:e$e$e$e$e$eCg d‹¢g dŒ¢e$e$e$e$e0e0e0e0e0e0e>e:e$e$e$e$e$eCg d‹¢g d�¢e>eMe0e0eCeEe e0dƒd„�e0e>e>e$e$e-e$eVd‡ eVd‡ eVd‡ eVd‡ eVdŽ eVdŽ e$eVdŽ eVdŽ e0e0e&e;e;d�d�ge)eRe0e3e$e$eadˆd‘d’d“gd”d•„ d–D ƒ¢ƒe$eIe-e4e-e$e$e4g d—¢e$e)e$dNd˜ge*e$e$eVd‡ e$eSe"e-e+e+e+e+e+e+e+e+e+e+e+e+e+e+e+g d™¢e0e)e)e-g dš¢e3e+e3e+e$d›�œ0ZcdœdiZdd�dž„ ec e¡ D ƒZcdS ) ak  
The rcsetup module contains the validation code for customization using
Matplotlib's rc settings.

Each rc setting is assigned a function used to validate any attempted changes
to that setting.  The validation functions are defined in the rcsetup module,
and are used to construct the rcParams global object which stores the settings
and is referenced throughout Matplotlib.

The default values of the rc settings are set in the default matplotlibrc file.
Any additions or deletions to the parameter set listed here should also be
propagated to the :file:`matplotlibrc.template` in Matplotlib's root source
directory.
é    N)Ú	lru_cacheÚreduce)ÚNumber)Ú_apiÚcbook)Ú	ls_mapper)ÚColormapÚis_color_like©Úparse_fontconfig_pattern)Ú	JoinStyleÚCapStyle)ÚCyclerÚcycler)ZGTK3AggZ	GTK3CairoZGTK4AggZ	GTK4CairoZMacOSXZnbAggZQtAggZQtCairoZQt5AggZQt5CairoZTkAggZTkCairoZWebAggZWXZWXAggZWXCairo)ZaggZcairoZpdfZpgfZpsÚsvgÚtemplatec                   @   s$   e Zd Zdddœdd„Zdd„ ZdS )	ÚValidateInStringsFN)Ú_deprecated_sincec                   s6   || _ ˆ| _|| _‡fdd„‰ ‡ fdd„|D ƒ| _dS )z#*valid* is a list of legal strings.c                    s   ˆ r|   ¡ S | S d S ©N)Úlower©Ús©Ú
ignorecase© úR/home/ja/django-apps/lartica_env/lib/python3.9/site-packages/matplotlib/rcsetup.pyÚfunc;   s    z(ValidateInStrings.__init__.<locals>.funcc                    s   i | ]}ˆ |ƒ|“qS r   r   )Ú.0Úk)r   r   r   Ú
<dictcomp>@   ó    z.ValidateInStrings.__init__.<locals>.<dictcomp>N)Úkeyr   r   Úvalid)Úselfr!   r"   r   r   r   )r   r   r   Ú__init__4   s
    zValidateInStrings.__init__c                    sÌ   ˆ j r2‡ fdd„tƒ  ¡ D ƒ\}tjˆ j |dd� ˆ jr@| ¡ }|ˆ jv rTˆ j| S |›dˆ j› dg ˆ j 	¡ ¢› �}t
|tƒrÀ| d¡r’| d¡s¦| d¡rÀ| d¡rÀ|d	d
… ˆ jv rÀ|d7 }t|ƒ‚d S )Nc                 3   s   | ]\}}|ˆ u r|V  qd S r   r   ©r   r   Úv©r#   r   r   Ú	<genexpr>D   r    z-ValidateInStrings.__call__.<locals>.<genexpr>Úfunction)ÚnameÚobj_typez is not a valid value for z; supported values are ú"ú'é   éÿÿÿÿz'; remove quotes surrounding your string)r   ÚglobalsÚitemsr   Úwarn_deprecatedr   r   r"   r!   ÚvaluesÚ
isinstanceÚstrÚ
startswithÚendswithÚ
ValueError)r#   r   r*   Úmsgr   r'   r   Ú__call__B   s2    ÿ

ÿ
ÿÿþþýzValidateInStrings.__call__)F)Ú__name__Ú
__module__Ú__qualname__r$   r:   r   r   r   r   r   3   s   ÿr   F)ÚnÚdocc                   s~   ‡ ‡‡fdd„}zd  ˆj¡|_W n$ tyF   d  tˆƒj¡|_Y n0 |j dd¡d d |j |_|d urr|nˆj|_|S )Nc                    sÆ   t | tƒrVz‡fdd„|  d¡D ƒ}W q� tyR   ˆ rL‡fdd„| D ƒ}n‚ Y q�0 n:t | ¡r‚t | ttfƒs‚‡fdd„| D ƒ}ntd| › �ƒ‚ˆd urÂt	|ƒˆkrÂtdˆ› dt	|ƒ› d	| › �ƒ‚|S )
Nc                    s    g | ]}|  ¡ rˆ |  ¡ ƒ‘qS r   ©Ústrip©r   r&   ©Úscalar_validatorr   r   Ú
<listcomp>[   s   ÿz1_listify_validator.<locals>.f.<locals>.<listcomp>ú,c                    s    g | ]}|  ¡ rˆ |  ¡ ƒ‘qS r   r@   rB   rC   r   r   rE   a   r    c                    s"   g | ]}t |tƒr|rˆ |ƒ‘qS r   )r4   r5   rB   rC   r   r   rE   k   s   ÿz0Expected str or other non-set iterable, but got z	Expected z values, but there are z values in )
r4   r5   ÚsplitÚ	ExceptionÚnpÚiterableÚsetÚ	frozensetr8   Úlen)r   Úval©Úallow_stringlistr>   rD   r   r   ÚfX   s"    

ÿÿz_listify_validator.<locals>.fz{}listz{}ListÚ.r.   r   )Úformatr;   ÚAttributeErrorÚtyper=   ÚrsplitÚ__doc__)rD   rP   r>   r?   rQ   r   rO   r   Ú_listify_validatorU   s    rX   c                 C   s   | S r   r   r   r   r   r   Úvalidate_any~   s    rY   c                 C   s6   zt  | ¡ | W S  ty0   t| ›d�ƒ‚Y n0 d S )Nz: should be a string that can be parsed by numpy.datetime64)rI   Z
datetime64r8   r   r   r   r   Ú_validate_dateƒ   s    
ÿrZ   c                 C   s:   t | tƒr|  ¡ } | dv rdS | dv r*dS td|  ƒ‚dS )zConvert b to ``bool`` or raise.)ÚtÚyÚyesÚonÚtrueÚ1r.   TT)rQ   r>   ÚnoÚoffÚfalseÚ0r   FFzCould not convert "%s" to boolN©r4   r5   r   r8   )Úbr   r   r   Úvalidate_boolŒ   s    
rg   c                 C   sF   z
t | ƒW S  ty4   t| tƒr0| dkr0Y dS Y n0 td|  ƒ‚d S )NÚlinez2%s cannot be interpreted as True, False, or "line")rg   r8   r4   r5   r   r   r   r   Úvalidate_axisbelow˜   s    

ÿri   c              
   C   sV   | dkr| S z
t | ƒW S  tyP } z"t| ›d| ›d�ƒ|‚W Y d}~n
d}~0 0 dS )z<Confirm s is string 'figure' or convert s to float or raise.Úfigurez. is not string "figure" and could not convert z	 to floatN©Úfloatr8   ©r   Úer   r   r   Úvalidate_dpi£   s    
ÿÿro   )Ú
allow_nonec                   sP   ‡ ‡fdd„}dˆj › �|_ ˆ r.| j d7  _ |j dd¡d d |j  |_|S )zp
    Return a validator that converts inputs to *cls* or raises (and possibly
    allows ``None`` as well).
    c              
      s–   ˆ r&| d u s"t | tƒr&|  ¡ dkr&d S ˆtu rFt | tƒsFtjddd� z
ˆ| ƒW S  ttfy� } z$td| ›dˆj› �ƒ|‚W Y d }~n
d }~0 0 d S )NÚnonez3.5z‘Support for setting an rcParam that expects a str value to a non-str value is deprecated since %(since)s and support will be removed %(removal)s.)ÚmessagezCould not convert z to )r4   r5   r   r   r2   Ú	TypeErrorr8   r;   rm   ©rp   Úclsr   r   Ú	validator´   s(    ÿÿ
ÿÿ
ÿÿz'_make_type_validator.<locals>.validatorZ	validate_Z_or_NonerR   r.   r   )r;   r=   rV   )ru   rp   rv   r   rt   r   Ú_make_type_validator®   s    ÿrw   Tzreturn a list of strings)r?   zreturn a list of floatsc                 C   s&   t | ttjfƒrt | ¡S t| ƒS d S r   )r4   r5   ÚosÚPathLikeÚfsdecodeÚvalidate_stringr   r   r   r   Ú_validate_pathlike×   s    
r|   c                 C   sœ   dddœ}zt | ƒ}W n\ tyr   z||  ¡  W  Y S  tyl } ztdt|ƒ ƒ|‚W Y d}~n
d}~0 0 Y n&0 || ¡ vr”tdt| ¡ ƒ ƒ‚|S dS )z`
    Confirm that this is a Postscript or PDF font type that we know how to
    convert to.
    é   é*   )Ztype3Ztruetypez*Supported Postscript/PDF font types are %sN)Úvalidate_intr8   r   ÚKeyErrorÚlistr3   )r   Z	fonttypesZfonttypern   r   r   r   Úvalidate_fonttypeà   s*    ÿÿÿ
ÿÿr‚   Úbackendr   c                 C   s"   | t u s|  d¡r| nt| ƒ}|S )Nz	module://)Ú_auto_backend_sentinelr6   Ú_validate_standard_backends)r   rƒ   r   r   r   Úvalidate_backendü   s    þr†   c                 C   s,   t dg d¢dd�| ƒ} | dkr(t d¡ | S )NÚtoolbar)ÚNoneZtoolbar2ÚtoolmanagerTr   r‰   zyTreat the new Tool classes introduced in v1.5 as experimental for now; the API and rcParam may change in future versions.)r   r   Zwarn_externalr   r   r   r   Ú_validate_toolbar  s    
ÿÿÿrŠ   c                 C   s   t  | d¡r| S t| ƒS )úReturn a valid color arg.Úinherit©r   Ú
_str_equalÚvalidate_colorr   r   r   r   Úvalidate_color_or_inherit  s    r�   c                 C   s   t  | d¡r| S t| ƒS )NÚautor�   r   r   r   r   Úvalidate_color_or_auto  s    r’   c                 C   s.   t | tƒr&t d| ¡r&td| ›d�ƒ‚t| ƒS )Nz^C[0-9]$zCannot put cycle reference (z) in prop_cycler)r4   r5   ÚreÚmatchr8   r�   r   r   r   r   Úvalidate_color_for_prop_cycle  s    r•   c                 C   sº   t  | d¡r| S t  | d¡s(t  | d¡r,dS t  | d¡sDt  | d¡rHdS | d u rTd S t| tƒrjt| ƒdksvt| ƒdkrœd|  }t|ƒrŠ|S |  ¡ d	kr¨d S nt| ƒr¨| S t| ›d
�ƒ‚d S )NZ	linecolorÚmfcÚmarkerfacecolorÚmecÚmarkeredgecoloré   é   ú#rq   ú does not look like a color arg)r   rŽ   r4   r5   rM   r	   r   r8   )r   Ústmpr   r   r   Ú_validate_color_or_linecolor!  s"    "rŸ   c              	   C   s–   t | tƒrF|  ¡ dkrdS t| ƒdks2t| ƒdkrFd|  }t|ƒrF|S t| ƒrR| S zt | ¡}W n ttfyv   Y n0 t|ƒr„|S t| ›d�ƒ‚dS )r‹   rq   rš   r›   rœ   r�   N)	r4   r5   r   rM   r	   ÚastÚliteral_evalÚSyntaxErrorr8   )r   rž   Úcolorr   r   r   r�   6  s     
r�   zreturn a list of colorspecs)rP   r?   c                 C   s   t jttf| d� | S )N)Zcmap)r   Úcheck_isinstancer5   r   r   r   r   r   Ú_validate_cmapS  s    r¥   c              
   C   sJ   | dv r| S z
t | ƒW S  tyD } ztdƒ|‚W Y d }~n
d }~0 0 d S )N)r‘   Úequalz not a valid aspect specificationrk   rm   r   r   r   Úvalidate_aspectX  s    
r§   c                 C   s    | d u s| dkrd S t | ƒS d S )Nrˆ   )Úvalidate_fontsizer   r   r   r   Úvalidate_fontsize_Nonea  s    r©   c              
   C   sr   g d¢}t | tƒr|  ¡ } | |v r&| S z
t| ƒW S  tyl } z$td| d |¡f ƒ|‚W Y d }~n
d }~0 0 d S )N)	zxx-smallzx-smallÚsmallÚmediumZlargezx-largezxx-largeZsmallerZlargerz5%s is not a valid font size. Valid font sizes are %s.z, )r4   r5   r   rl   r8   Újoin)r   Z	fontsizesrn   r   r   r   r¨   h  s    

ÿÿr¨   c              
   C   s\   g d¢}| |v r| S z
t | ƒW S  ttfyV } zt| › d�ƒ|‚W Y d }~n
d }~0 0 d S )N)Z
ultralightÚlightÚnormalÚregularÚbookr«   ÚromanZsemiboldZdemiboldZdemiÚboldZheavyz
extra boldÚblackz is not a valid font weight.)Úintr8   rs   )r   Úweightsrn   r   r   r   Úvalidate_fontweighty  s    
r¶   c                 C   s   t | ƒ | S r   r
   r   r   r   r   Úvalidate_font_properties†  s    r·   c                 C   s\   g d¢}t | tƒr|  ¡ } | d u s*| dkr.d S |  ¡ |v r>| S t| › dd |¡› d�ƒ‚d S )N)ÚcmÚstixÚstixsansrq   zB is not a valid fallback font name. Valid fallback font names are rF   z(. Passing 'None' will turn fallback off.)r4   r5   r   r8   r¬   )r   Z_fallback_fontsr   r   r   Ú_validate_mathtext_fallback‹  s    
ÿÿr»   c                 C   sl   zt tdd�| ƒW S  ttfyf   zt| ƒW  Y S  ty` } ztdƒ|‚W Y d }~n
d }~0 0 Y n0 d S )Né   ©r>   z:Not a valid whisker value ['range', float, (float, float)])rX   Úvalidate_floatrs   r8   rl   rm   r   r   r   Úvalidate_whiskersš  s    ÿr¿   c                 C   s4   t | tƒr|  ¡ } | dv rd S tdddgƒ| ƒS d S )N)rq   Nrc   Fúps.usedistillerZghostscriptZxpdf)r4   r5   r   r   r   r   r   r   Úvalidate_ps_distiller¥  s
    
rÁ   Ú	linestylerˆ   rq   ú Ú c              	   C   sÐ   t | tƒrNz
t| ƒW S  ty&   Y n0 zt | ¡} W n ttfyL   Y n0 dd„ }|| ƒr¼t| ƒdkr€|| d ƒr€| \}}nd}| }t |tƒr¼t|ƒd dkr¼t	dd„ |D ƒƒr¼||fS td| ›d	�ƒ‚d
S )zf
    A validator for all possible line styles, the named ones *and*
    the on-off ink sequences.
    c                 S   s   t  | ¡ot| tttfƒ S r   )rI   rJ   r4   r5   ÚbytesÚ	bytearray)Úxr   r   r   Ú_is_iterable_not_string_likeÅ  s    z9_validate_linestyle.<locals>._is_iterable_not_string_liker¼   r.   r   c                 s   s   | ]}t |tƒV  qd S r   )r4   r   )r   Úelemr   r   r   r(   Õ  r    z&_validate_linestyle.<locals>.<genexpr>z
linestyle z$ is not a valid on-off ink sequence.N)
r4   r5   Ú_validate_named_linestyler8   r    r¡   r¢   rM   r   Úall)ÚlsrÈ   ÚoffsetZonoffr   r   r   Ú_validate_linestyle¶  s,    



ÿþrÎ   úmarkers.fillstyle)ÚfullÚleftÚrightÚbottomÚtoprq   c                 C   s”   t | ttttdƒfƒr| S t | tƒr`t| ƒdkrXtdd„ | D ƒƒsTtdd„ | D ƒƒrX| S tdƒ‚t | t	ƒrˆtdd„ | D ƒƒr€| S tdƒ‚td	ƒ‚dS )
a  
    Validate the markevery property of a Line2D object.

    Parameters
    ----------
    s : None, int, (int, int), slice, float, (float, float), or list[int]

    Returns
    -------
    None, int, (int, int), slice, float, (float, float), or list[int]
    Nr¼   c                 s   s   | ]}t |tƒV  qd S r   ©r4   r´   ©r   rn   r   r   r   r(   ô  r    z%validate_markevery.<locals>.<genexpr>c                 s   s   | ]}t |tƒV  qd S r   )r4   rl   rÖ   r   r   r   r(   õ  r    z3'markevery' tuple must be pair of ints or of floatsc                 s   s   | ]}t |tƒV  qd S r   rÕ   rÖ   r   r   r   r(   ü  r    z3'markevery' list must have all elements of type intz!'markevery' is of an invalid type)
r4   Úslicerl   r´   rU   ÚtuplerM   rË   rs   r�   r   r   r   r   Úvalidate_markeveryâ  s&    
ÿþÿ
ÿrÙ   c                 C   sH   t | tƒr4|  ¡ } | dkr| S | dkr*d S tdƒ‚n| d urDtdƒ‚| S )NZtightÚstandardz$bbox should be 'tight' or 'standard're   r   r   r   r   Úvalidate_bbox  s    

rÛ   c                 C   s\   t | tƒr|  ¡ } | dks"| d u r&d S ztttdd�| ƒƒW S  tyV   tdƒ‚Y n0 d S )Nrq   r}   r½   z.Expected a (scale, length, randomness) triplet)r4   r5   r   rØ   rX   r¾   r8   r   r   r   r   Úvalidate_sketch  s    
rÜ   c                 C   s6   t | ƒ} d|   krdk r$n n| S td| › �ƒ‚d S )Nr   r.   zValue must be >=0 and <1; got ©r¾   ÚRuntimeErrorr   r   r   r   Ú!_validate_greaterequal0_lessthan1   s    rß   c                 C   s6   t | ƒ} d|   krdkr$n n| S td| › �ƒ‚d S )Nr   r.   zValue must be >=0 and <=1; got rÝ   r   r   r   r   Ú"_validate_greaterequal0_lessequal1(  s    rà   )ú
0 <= x < 1ú0 <= x <= 1c                 C   sH   t | tƒstdƒ‚tjt| d� t| ƒh d£ }|rDtdt|ƒ ƒ‚| S )zŽ
    Validate a hatch pattern.
    A hatch pattern string can have any sequence of the following
    characters: ``\ / | - + * . x o O``.
    zHatch pattern must be a string)Zhatch_pattern>
   ú-ÚOú|ú/rR   ú+ú\rÇ   Ú*ÚozUnknown hatch symbol(s): %s)r4   r5   r8   r   r¤   rK   r�   )r   Úunknownr   r   r   Úvalidate_hatch6  s    
rì   )rP   )r£   Ú	linewidthrÂ   Ú	facecolorÚ	edgecolorZ	joinstyleZcapstyleZ	fillstyler—   Ú
markersizeÚmarkeredgewidthr™   Z	markeveryÚalphaÚmarkerZhatchÚdashesr£   rí   rî   rï   r—   r™   rñ   rð   )	ÚcZlwrÌ   ZfcÚecr–   r˜   ZmewÚmsc                  O   sø   | r|rt dƒ‚n| s"|s"t dƒ‚t| ƒdkrPt| d tƒsDt dƒ‚t| d ƒS t| ƒdkrp| d | d fg}nt| ƒdkr†t dƒ‚n| ¡ }g }|D ]J\}}t ||¡}t |d¡}|du rÊt d	| ƒ‚||ƒ}| 	||f¡ q–t
tjd
d„ |D ƒƒS )a!  
    Create a `~cycler.Cycler` object much like :func:`cycler.cycler`,
    but includes input validation.

    Call signatures::

      cycler(cycler)
      cycler(label=values[, label2=values2[, ...]])
      cycler(label, values)

    Form 1 copies a given `~cycler.Cycler` object.

    Form 2 creates a `~cycler.Cycler` which cycles over one or more
    properties simultaneously. If multiple properties are given, their
    value lists must have the same length.

    Form 3 creates a `~cycler.Cycler` for a single property. This form
    exists for compatibility with the original cycler. Its use is
    discouraged in favor of the kwarg form, i.e. ``cycler(label=values)``.

    Parameters
    ----------
    cycler : Cycler
        Copy constructor for Cycler.

    label : str
        The property key. Must be a valid `.Artist` property.
        For example, 'color' or 'linestyle'. Aliases are allowed,
        such as 'c' for 'color' and 'lw' for 'linewidth'.

    values : iterable
        Finite-length iterable of the property values. These values
        are validated and will raise a ValueError if invalid.

    Returns
    -------
    Cycler
        A new :class:`~cycler.Cycler` for the given properties.

    Examples
    --------
    Creating a cycler for a single property:

    >>> c = cycler(color=['red', 'green', 'blue'])

    Creating a cycler for simultaneously cycling over multiple properties
    (e.g. red circle, green plus, blue cross):

    >>> c = cycler(color=['red', 'green', 'blue'],
    ...            marker=['o', '+', 'x'])

    zEcycler() can only accept positional OR keyword arguments -- not both.z2cycler() must have positional OR keyword argumentsr.   r   zDIf only one positional argument given, it must be a Cycler instance.r¼   z+No more than 2 positional arguments allowedNzUnknown artist property: %sc                 s   s   | ]\}}t ||ƒV  qd S r   )Úccyclerr%   r   r   r   r(   ¼  r    zcycler.<locals>.<genexpr>)rs   rM   r4   r   Úvalidate_cyclerr1   Ú_prop_aliasesÚgetÚ_prop_validatorsÚappendr   ÚoperatorÚadd)ÚargsÚkwargsÚpairsZ	validatedÚpropÚvalsÚ	norm_proprv   r   r   r   r   j  s,    5

r   c                   @   s   e Zd Zdd„ ZdS )Ú_DunderCheckerc                 C   s.   |j  d¡r |j  d¡r tdƒ‚|  |¡ d S )NÚ__z)cycler strings with dunders are forbidden)Úattrr6   r7   r8   Úgeneric_visit)r#   Únoder   r   r   Úvisit_AttributeÀ  s    z_DunderChecker.visit_AttributeN)r;   r<   r=   r  r   r   r   r   r  ¿  s   r  c           	   
   C   sv  t | tƒrhz&tƒ  t | ¡¡ t| ti dœƒ} W n6 tyf } zt	d| |f ƒ|‚W Y d}~n
d}~0 0 t | t
ƒrx| }nt	d|  ƒ‚|jttƒttƒB  }|rªt	d| ƒ‚tƒ }|jD ]X}t ||¡}||krè||jv rèt	d ||¡ƒ‚||v �rt	d ||¡ƒ‚| |g¡ q¶t|ƒt|jƒk�s(J ‚|jD ]}t ||¡}| ||¡ �q.| ¡  ¡ D ]\}}t| |ƒ �qZ|S )z?Return a Cycler object from a string repr or the object itself.)r   Ú__builtins__z+'%s' is not a valid cycler construction: %sNz.object was not a string or Cycler instance: %szUnknown artist properties: %sz@Cannot specify both '{0}' and alias '{1}' in the same prop_cyclezKAnother property was already aliased to '{0}'. Collision normalizing '{1}'.)r4   r5   r  Úvisitr    ÚparseÚevalr   ÚBaseExceptionr8   r   ÚkeysrK   rü   rú   rû   rS   ÚupdaterM   Z
change_keyÚby_keyr1   )	r   rn   Zcycler_instZunknownsÚcheckerr  r  r!   r  r   r   r   rù   Æ  sH    
ÿÿ

ÿ
þ
rù   c              	   C   sp   g d¢}t | tƒr| |v r| S z
t| ƒW S  ttfy>   Y n0 z
t| ƒW S  ty\   Y n0 td |¡ƒ‚d S )N)r‘   ZsturgesÚfdZdoaneZscottÚriceÚsqrtz='hist.bins' must be one of {}, an int or a sequence of floats)r4   r5   r´   rs   r8   Úvalidate_floatlistrS   )r   Z
valid_strsr   r   r   Úvalidate_hist_bins  s    

ÿr  c                   @   s   e Zd ZdZdS )Ú_ignorecasezAA marker class indicating that a list-of-str is case-insensitive.N)r;   r<   r=   rW   r   r   r   r   r    s   r  c                 C   s*   t |tƒr"t |tƒ}t| ||d�S |S d S )Nr   )r4   r�   r  r   )r!   Úconvr   r   r   r   Ú_convert_validator_spec  s    

r  )r‘   ZflatZnearestZgouraud)ÚdefaultZno_autohintZforce_autohintZ
no_hintingr‘   ÚnativeZeitherrq   )Z
dejavusansZdejavuserifr¸   r¹   rº   Zcustom)ZrmÚcalÚitÚttZsfÚbfr  ZbbZfrakZscrr¯   Úupperr   )rÑ   ÚcenterrÒ   )rÓ   r$  rÔ   )ÚminorÚbothÚmajor)rÇ   r\   r&  r¼   r½   ÚdataZround_numbersrâ   r‘   Zconcise)Úbestzupper rightz
upper leftz
lower leftzlower rightrÒ   zcenter leftzcenter rightzlower centerzupper centerr$  )ÚoutÚinZinout)r$  rÒ   rÑ   )r$  rÔ   rÓ   ZbaselineZcenter_baselinerá   Z	landscapeZportraitÚletterZlegalÚledgerc                 C   s&   g | ]}t d ƒD ]}|› |› �‘qqS )é   )Úrange)r   ÚabÚir   r   r   rE   Š  s   ÿrE   r0  )ZxelatexZlualatexZpdflatexÚpath)Úhtml5Zjshtmlrq   )
ZpngZjpegZtiffÚrawZrgbaÚppmZsgiZbmpZpbmr   (0  rƒ   Zbackend_fallbackr‡   ÚinteractiveÚtimezonezwebagg.portzwebagg.addresszwebagg.open_in_browserzwebagg.port_retrieszlines.linewidthzlines.linestylezlines.colorzlines.markerzlines.markerfacecolorzlines.markeredgecolorzlines.markeredgewidthzlines.markersizezlines.antialiasedzlines.dash_joinstylezlines.solid_joinstylezlines.dash_capstylezlines.solid_capstylezlines.dashed_patternzlines.dashdot_patternzlines.dotted_patternzlines.scale_dashesrÏ   zpcolor.shadingzpcolormesh.snapzpatch.linewidthzpatch.edgecolorzpatch.force_edgecolorzpatch.facecolorzpatch.antialiasedzhatch.colorzhatch.linewidthz	hist.binszboxplot.notchzboxplot.verticalzboxplot.whiskerszboxplot.bootstrapzboxplot.patchartistzboxplot.showmeanszboxplot.showcapszboxplot.showboxzboxplot.showflierszboxplot.meanlinezboxplot.flierprops.colorzboxplot.flierprops.markerz"boxplot.flierprops.markerfacecolorz"boxplot.flierprops.markeredgecolorz"boxplot.flierprops.markeredgewidthzboxplot.flierprops.markersizezboxplot.flierprops.linestylezboxplot.flierprops.linewidthzboxplot.boxprops.colorzboxplot.boxprops.linewidthzboxplot.boxprops.linestylezboxplot.whiskerprops.colorzboxplot.whiskerprops.linewidthzboxplot.whiskerprops.linestylezboxplot.capprops.colorzboxplot.capprops.linewidthzboxplot.capprops.linestylezboxplot.medianprops.colorzboxplot.medianprops.linewidthzboxplot.medianprops.linestylezboxplot.meanprops.colorzboxplot.meanprops.markerz!boxplot.meanprops.markerfacecolorz!boxplot.meanprops.markeredgecolorzboxplot.meanprops.markersizezboxplot.meanprops.linestylezboxplot.meanprops.linewidthzfont.familyz
font.stylezfont.variantzfont.stretchzfont.weightz	font.sizez
font.serifzfont.sans-serifzfont.cursivezfont.fantasyzfont.monospacez
text.colorztext.usetexztext.latex.preambleztext.hintingztext.hinting_factorztext.kerning_factorztext.antialiasedzmathtext.calzmathtext.rmzmathtext.ttzmathtext.itzmathtext.bfzmathtext.sfzmathtext.fontsetzmathtext.defaultzmathtext.fallbackzimage.aspectzimage.interpolationz
image.cmapz	image.lutzimage.originzimage.resamplezimage.composite_imagezcontour.negative_linestylezcontour.corner_maskzcontour.linewidthzerrorbar.capsizezxaxis.labellocationzyaxis.labellocationzaxes.axisbelowzaxes.facecolorzaxes.edgecolorzaxes.linewidthzaxes.spines.leftzaxes.spines.rightzaxes.spines.bottomzaxes.spines.topzaxes.titlesizezaxes.titlelocationzaxes.titleweightzaxes.titlecolorzaxes.titleyzaxes.titlepadz	axes.gridzaxes.grid.whichzaxes.grid.axiszaxes.labelsizezaxes.labelpadzaxes.labelweightzaxes.labelcolorzaxes.formatter.limitszaxes.formatter.use_localezaxes.formatter.use_mathtextzaxes.formatter.min_exponentzaxes.formatter.useoffsetzaxes.formatter.offset_thresholdzaxes.unicode_minuszaxes.prop_cyclezaxes.autolimit_modezaxes.xmarginzaxes.ymarginzaxes.zmarginzpolaraxes.gridzaxes3d.gridzscatter.markerzscatter.edgecolorsz
date.epochzdate.autoformatter.yearzdate.autoformatter.monthzdate.autoformatter.dayzdate.autoformatter.hourzdate.autoformatter.minutezdate.autoformatter.secondzdate.autoformatter.microsecondzdate.converterzdate.interval_multipleszlegend.fancyboxz
legend.loczlegend.numpointszlegend.scatterpointszlegend.fontsizezlegend.title_fontsizezlegend.labelcolorzlegend.markerscalezlegend.shadowzlegend.frameonzlegend.framealphazlegend.borderpadzlegend.labelspacingzlegend.handlelengthzlegend.handleheightzlegend.handletextpadzlegend.borderaxespadzlegend.columnspacingzlegend.facecolorzlegend.edgecolorz	xtick.topzxtick.bottomzxtick.labeltopzxtick.labelbottomzxtick.major.sizezxtick.minor.sizezxtick.major.widthzxtick.minor.widthzxtick.major.padzxtick.minor.padzxtick.colorzxtick.labelcolorzxtick.minor.visiblezxtick.minor.topzxtick.minor.bottomzxtick.major.topzxtick.major.bottomzxtick.labelsizezxtick.directionzxtick.alignmentz
ytick.leftzytick.rightzytick.labelleftzytick.labelrightzytick.major.sizezytick.minor.sizezytick.major.widthzytick.minor.widthzytick.major.padzytick.minor.padzytick.colorzytick.labelcolorzytick.minor.visiblezytick.minor.leftzytick.minor.rightzytick.major.leftzytick.major.rightzytick.labelsizezytick.directionzytick.alignmentz
grid.colorzgrid.linestylezgrid.linewidthz
grid.alphazfigure.titlesizezfigure.titleweightzfigure.figsizez
figure.dpizfigure.facecolorzfigure.edgecolorzfigure.frameonzfigure.autolayoutzfigure.max_open_warningzfigure.raise_windowzfigure.subplot.leftzfigure.subplot.rightzfigure.subplot.bottomzfigure.subplot.topzfigure.subplot.wspacezfigure.subplot.hspacezfigure.constrained_layout.usez figure.constrained_layout.hspacez figure.constrained_layout.wspacezfigure.constrained_layout.h_padzfigure.constrained_layout.w_padzsavefig.dpizsavefig.facecolorzsavefig.edgecolorzsavefig.orientationzsavefig.formatzsavefig.bboxzsavefig.pad_incheszsavefig.directoryzsavefig.transparentztk.window_focuszps.papersizez	ps.useafmrÀ   zps.distiller.reszps.fonttypezpdf.compressionzpdf.inheritcolorzpdf.use14corefontszpdf.fonttypezpgf.texsystemzpgf.rcfontszpgf.preamblezsvg.image_inlinezsvg.fonttypezsvg.hashsaltzdocstring.hardcopyzpath.simplifyzpath.simplify_thresholdz	path.snapzpath.sketchzpath.effectszagg.path.chunksizezkeymap.fullscreenzkeymap.homezkeymap.backzkeymap.forwardz
keymap.panzkeymap.zoomzkeymap.savezkeymap.quitzkeymap.quit_allzkeymap.gridzkeymap.grid_minorzkeymap.yscalezkeymap.xscalezkeymap.helpzkeymap.copyzanimation.htmlzanimation.embed_limitzanimation.writerzanimation.codeczanimation.bitratezanimation.frame_formatzanimation.ffmpeg_pathzanimation.ffmpeg_argszanimation.convert_pathzanimation.convert_argsú_internal.classic_moder8  c                 C   s   i | ]\}}|t ||ƒ“qS r   )r  )r   r   r  r   r   r   r   Ü  s   ÿr   )F)frW   r    Ú	functoolsr   r   Únumbersr   rþ   rx   r“   ÚnumpyrI   Z
matplotlibr   r   Zmatplotlib.cbookr   Zmatplotlib.colorsr   r	   Zmatplotlib.fontconfig_patternr   Zmatplotlib._enumsr   r   r   r   rø   Zinteractive_bkZnon_interactive_bkZall_backendsr   rX   rY   Zvalidate_anylistrZ   rg   ri   ro   rw   r5   r{   Zvalidate_string_or_NoneZvalidate_stringlistr´   r   Zvalidate_int_or_Nonerl   r¾   Zvalidate_float_or_Noner  r|   r‚   r…   Úobjectr„   r†   rŠ   r�   r’   r•   rŸ   r�   Zvalidate_colorlistr¥   r§   r©   r¨   Zvalidate_fontsizelistr¶   r·   r»   r¿   rÁ   r  r3   rÊ   rÎ   Zvalidate_fillstyleZvalidate_fillstylelistrÙ   Zvalidate_markeverylistrÛ   rÜ   rß   rà   Z_range_validatorsrì   Zvalidate_hatchlistZvalidate_dashlistrü   rú   ÚNodeVisitorr  rù   r  r�   r  r  Z_validatorsZ_hardcoded_defaultsr1   r   r   r   r   Ú<module>   sx  	"ÿ(	ÿÿ	ÿ
ÿ	"ý%ÿ"	þÿî÷U<


ÿÿ€ € € Ð   7þÿ