
    l0j                     N    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dS )    Nc                     t          j        |          sDt          |t          j        j                  r't          |          dk    rt          |  d          dS dS dS )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     \/home/wildlama/miniconda3/envs/lam/lib/python3.11/site-packages/matplotlib/_style_helpers.pycheck_non_emptyr      sq    %e,, @uko344@9<Uq3>>>???@ @ @ @9H    c                 B   i i }|                                  D ]\  }}|dv ri|t          j        |d          rt          j        |          |<   8t          ||           t          j        t          j        |                    |<   r|dv r:t          ||           t          j        t          j
        |                    |<   |dk    r:t          ||           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	edgecolorNnone)hatch	linewidth	linestylec               3   L   K   	 d                                   D             V  !)NTc                 4    i | ]\  }}|t          |          S  )next).0r   vals      r   
<dictcomp>z6style_generator.<locals>.style_gen.<locals>.<dictcomp>1   s$    GGGhc33S		GGGr   )items)kw_iteratorss   r   	style_genz"style_generator.<locals>.style_gen/   s9      	HGG,2D2D2F2FGGGGGG	Hr   )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.      sP    LLhhjj & &
U,,,} 6uf E E}$-$4U$;$;S!!U+++$-OG4I%4P4P$Q$QS!!***C''' )e0D0D E ELKC''' )0I%0P0P Q QL !&LH H H H H $$r   )collections.abcr   r#   numpyr(   matplotlib.cbookr   matplotlib.colorscolorsr&   matplotlib.lineslinesr*   r   r.   r   r   r   <module>r6      s                            # # # # # # ! ! ! ! ! !@ @ @!% !% !% !% !%r   