
    ^j                     L    d dl Zd dlZd dlZd dlmZ d dlmZ	 d dl
mZ d Zd Zy)    Nc                     t        j                  |      sBt        |t        j                  j
                        rt        |      dk(  rt        |  d      yyy)z0Raise a TypeError if an empty sequence is passedr   z must not be an empty sequenceN)cbookis_scalar_or_string
isinstancecollectionsabcSizedlen	TypeError)keyvalues     R/opt/ringagent/.cad-venv/lib/python3.12/site-packages/matplotlib/_style_helpers.pycheck_non_emptyr      sO    %%e,ukoo334Uq3%=>?? :I4 -    c                 .   i i }| j                         D ]  \  }}|dv ri|t        j                  |d      rt        j                  |      |<   ;t        ||       t        j                  t        j                  |            |<   s|dv r8t        ||       t        j                  t        j                  |            |<   |dk(  r8t        ||       t        j                  t        j                  |            |<   |||<    fd}| |       fS )a~  
    Helper for handling style sequences (e.g. facecolor=['r', 'b', 'k']) within plotting
    methods that repeatedly call other plotting methods (e.g. hist, stackplot).  Remove
    style keywords from the given dictionary.  Return the reduced dictionary together
    with a generator which provides a series of dictionaries to be used in each call to
    the wrapped function.
    )	facecolor	edgecolornone)hatch	linewidth	linestylec               3   z   K   	 j                         D  ci c]  \  } }| t        |       c}}  0c c}} w w)N)itemsnext)r   valkw_iteratorss     r   	style_genz"style_generator.<locals>.style_gen/   s8     2>2D2D2FGhc33S	>GG Gs   ;5;)r   r   _str_lower_equal	itertoolsrepeatr   cyclemcolorsto_rgba_arraynp
atleast_1dmlines_get_dash_patterns)kwremaining_kwr   r   r   r   s        @r   style_generatorr*      s    LLhhj &
U,,} 6 6uf E$-$4$4U$;S!U+$-OOG4I4I%4P$QS!**C' )e0D ELKC' )0I0I%0P QL !&L#&&H $$r   )collections.abcr   r   numpyr$   matplotlib.cbookr   matplotlib.colorscolorsr"   matplotlib.lineslinesr&   r   r*    r   r   <module>r3      s"         # !@!%r   