
    h                      6   S r SSKrSSKrSSKrSSKrSSKJr  SSKrSSK	r
SSK	JrJrJrJr  \R                  " \5      r/ SQr\R&                  R)                  \
R*                  " 5       S5      r\R&                  R)                  \
R.                  " 5       S5      /rSr1 Skr\R6                  " S	R)                  \" S
R:                  \" \\R@                  S95      5      5      S 5       r!\RD                  SS j5       r#S r$S r%S r&\%" \5      r'0 r(/ r)S r*\*" 5         g)aD  
Core functions and attributes for the matplotlib style library:

``use``
    Select style sheet to override the current matplotlib settings.
``context``
    Context manager to use a style sheet temporarily.
``available``
    List available style sheets.
``library``
    A dictionary of style names and matplotlib settings.
    N)Path)_api
_docstring_rc_params_in_filercParamsDefault)usecontext	availablelibraryreload_librarystylelibmplstyle>   backendtoolbartimezoneinteractivebackend_fallback
date.epochwebagg.portwebagg.addresstk.window_focussavefig.directorydocstring.hardcopyfigure.raise_windowwebagg.port_retrieswebagg.open_in_browserfigure.max_open_warning
z- {})keyc                    [        U [        [        45      (       d  [        U S5      (       a  U /nOU nSSS.nU GH\  n [        U [        5      (       a  UR	                  X 5      n U S:X  aI  [
        R                  " 5          [         Vs0 s H  nU[        ;  d  M  U[        U   _M     n nSSS5        OeU [        ;   a
  [        U    n OQSU ;   aK  U R                  S5      u  pEn [        R                  R                  U5      U S[         3-  n[        U5      n [        U [        [        45      (       a   [        U 5      n 0 n
U  H0  nU[        ;   a  [
        R&                  " SU< S	35        M*  X   X'   M2     [(        R*                  R-                  U
5        GM_     gs  snf ! , (       d  f       N= f! [         ["        [$        4 a
  n SnANSnAff = f! ["         a  n	[#        U < S35      U	eSn	A	ff = f)
aW  
Use Matplotlib style settings from a style specification.

The style name of 'default' is reserved for reverting back to
the default style settings.

.. note::

   This updates the `.rcParams` with the settings from the style.
   `.rcParams` not defined in the style are kept.

Parameters
----------
style : str, dict, Path or list

    A style specification. Valid options are:

    str
        - One of the style names in `.style.available` (a builtin style or
          a style installed in the user library path).

        - A dotted name of the form "package.style_name"; in that case,
          "package" should be an importable Python package name, e.g. at
          ``/path/to/package/__init__.py``; the loaded style file is
          ``/path/to/package/style_name.mplstyle``.  (Style files in
          subpackages are likewise supported.)

        - The path or URL to a style file, which gets loaded by
          `.rc_params_from_file`.

    dict
        A mapping of key/value pairs for `matplotlib.rcParams`.

    Path
        The path to a style file, which gets loaded by
        `.rc_params_from_file`.

    list
        A list of style specifiers (str, Path or dict), which are applied
        from first to last in the list.

Notes
-----
The following `.rcParams` are not related to style and will be ignored if
found in a style specification:

%s
keysdefaultclassic)mpl20mpl15N.z is not a valid package style, path of style file, URL of style file, or library style name (library styles are listed in `style.available`)zStyle includes a parameter, z9, that is not related to style.  Ignoring this parameter.)
isinstancestrr   hasattrgetr   'suppress_matplotlib_deprecation_warningr   STYLE_BLACKLISTr   
rpartition	importlib	resourcesfilesSTYLE_EXTENSIONr   ModuleNotFoundErrorOSError	TypeErrorwarn_externalmplrcParamsupdate)stylestylesstyle_aliaskpkg_namepathexcerrfiltereds              G/var/www/html/env/lib/python3.13/site-packages/matplotlib/style/core.pyr   r   *   s   h %#t%%)?)?%	:KeS!!OOE1E	! AAC<K :Oq ! 8 3Q 22OE : DC '!$//4
$..44S9tfAoEV<WWD.t4E ec4[))I*51 AO#""21% 8B CD $h  	H%S : DC ,Wi@    Ii  > ?@ FIIIsN   ?	F!FF(F!"6F24GF!!
F/	2GG
G3G..G3c              #      #    [         R                  " 5          U(       a  [         R                  " 5         [        U 5        Sv   SSS5        g! , (       d  f       g= f7f)a  
Context manager for using style settings temporarily.

Parameters
----------
style : str, dict, Path or list
    A style specification. Valid options are:

    str
        - One of the style names in `.style.available` (a builtin style or
          a style installed in the user library path).

        - A dotted name of the form "package.style_name"; in that case,
          "package" should be an importable Python package name, e.g. at
          ``/path/to/package/__init__.py``; the loaded style file is
          ``/path/to/package/style_name.mplstyle``.  (Style files in
          subpackages are likewise supported.)

        - The path or URL to a style file, which gets loaded by
          `.rc_params_from_file`.
    dict
        A mapping of key/value pairs for `matplotlib.rcParams`.

    Path
        The path to a style file, which gets loaded by
        `.rc_params_from_file`.

    list
        A list of style specifiers (str, Path or dict), which are applied
        from first to last in the list.

after_reset : bool
    If True, apply style after resetting settings to their defaults;
    otherwise, apply style on top of the current settings.
N)r6   
rc_context
rcdefaultsr   )r9   after_resets     rD   r	   r	      s4     J 
	NNE
	 
		s   A,A	A
AAc                     [        [        R                  R                  [        5       H  n[        U5      n[        X5        M     U $ )z0Update style library with user-defined rc files.)maposr@   
expanduserUSER_LIBRARY_PATHSread_style_directoryupdate_nested_dict)r   stylelib_pathr:   s      rD   update_user_libraryrQ      s8    RWW//1CD%m47+ E N    c                 F   [        5       n[        U 5      R                  S[         35       H`  n[        R
                  " SS9 n[        U5      XR                  '   SSS5        W H#  n[        R                  SX$R                  5        M%     Mb     U$ ! , (       d  f       N== f)z3Return dictionary of styles defined in *style_dir*.z*.T)recordNz	In %s: %s)dictr   globr1   warningscatch_warningsr   stem_logwarningmessage)	style_dirr:   r@   warnsws        rD   rN   rN      s|    VFY$$r/):%;<$$D1U 24 8F99 2ALLdII6  =
 M	 21s   B
B 	c                 z    UR                  5        H&  u  p#U R                  U0 5      R                  U5        M(     U $ )a  
Update nested dict (only level of nesting) with new values.

Unlike `dict.update`, this assumes that the values of the parent dict are
dicts (or dict-like), so you shouldn't replace the nested dict if it
already exists. Instead you should update the sub-dict.
)items
setdefaultr8   )	main_dictnew_dictr?   rc_dicts       rD   rO   rO      s8     ")T2&--g6 *rR   c                      [         R                  5         [         R                  [        [        5      5        [        [         R                  5       5      [        SS& g)zReload the style library.N)r   clearr8   rQ   _base_librarysortedr!   r
    rR   rD   r   r      s1    MMONN&}56',,.)IaLrR   )F)+__doc__
contextlibimportlib.resourcesr.   loggingrK   pathlibr   rW   
matplotlibr6   r   r   r   r   	getLogger__name__rZ   __all__r@   joinget_data_pathBASE_LIBRARY_PATHget_configdirrM   r1   r,   SubstitutionrJ   formatri   r(   lowerr   contextmanagerr	   rQ   rN   rO   rh   r   r
   r   rj   rR   rD   <module>r|      s      	    L L"
F GGLL!2!2!4jA ggll3#4#4#6
CD ( IIc&--SYY!GHIb&b&J ( (V  %%67
	*  rR   