§
    tŠtjM!  ã                  ó`  — d dl mZ d dlmZmZmZ d dlZd dlmZm	Z	m
Z
 d dlZ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 erd dlmZ e
	 	 d1d2d„¦   «         Ze
	 	 d1d	dœd3d„¦   «         Ze
	 	 d1d	dœd4d„¦   «         Z	 	 d5ddœd4d„Zd6d„Zd7d"„Zd8d$„Zd9d&„Zd:d(„Zd;d*„Zd<d,„Z d;d-„Z!d=d.„Z"d>d0„Z#dS )?é    )Úannotations)Ú
CollectionÚIteratorÚSequenceN)ÚTYPE_CHECKINGÚcastÚoverload)ÚMatplotlibColor)Úfind_stack_level)Úis_list_like)ÚColormap.Ú
num_colorsÚintÚcolormapúColormap | NoneÚ
color_typeÚstrÚcolorúdict[str, Color]Úreturnc               ó   — d S ©N© ©r   r   r   r   s       ú_/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/pandas/plotting/_matplotlib/style.pyÚget_standard_colorsr      s	   € ð �só    ©r   úColor | Sequence[Color] | Noneúlist[Color]c               ó   — d S r   r   r   s       r   r   r   '   s	   € ð �#r   ú1dict[str, Color] | Color | Sequence[Color] | Noneúdict[str, Color] | list[Color]c               ó   — d S r   r   r   s       r   r   r   1   s	   € ð &) Sr   Údefaultc               ó’   — t          |t          ¦  «        r|S t          |||| ¬¦  «        }t          t	          || ¬¦  «        ¦  «        S )a§  
    Get standard colors based on `colormap`, `color_type` or `color` inputs.

    Parameters
    ----------
    num_colors : int
        Minimum number of colors to be returned.
        Ignored if `color` is a dictionary.
    colormap : :py:class:`matplotlib.colors.Colormap`, optional
        Matplotlib colormap.
        When provided, the resulting colors will be derived from the colormap.
    color_type : {"default", "random"}, optional
        Type of colors to derive. Used if provided `color` and `colormap` are None.
        Ignored if either `color` or `colormap` are not None.
    color : dict or str or sequence, optional
        Color(s) to be used for deriving sequence of colors.
        Can be either be a dictionary, or a single color (single color string,
        or sequence of floats representing a single color),
        or a sequence of colors.

    Returns
    -------
    dict or list
        Standard colors. Can either be a mapping if `color` was a dictionary,
        or a list of colors with a length of `num_colors` or more.

    Warns
    -----
    UserWarning
        If both `colormap` and `color` are provided.
        Parameter `color` will override.
    ©r   r   r   r   ©r   )Ú
isinstanceÚdictÚ_derive_colorsÚlistÚ_cycle_colors)r   r   r   r   Úcolorss        r   r   r   ;   sY   € õN �%�ÑÔð ØˆåØØØØð	ñ ô €Fõ •˜f°Ð<Ñ<Ô<Ñ=Ô=Ð=r   ú Color | Collection[Color] | Noneústr | Colormap | Nonec                ó¸   — | €|�t          ||¬¦  «        S | �3|�"t          j        dt          ¦   «         ¬¦  «         t	          | ¦  «        S t          ||¬¦  «        S )aa  
    Derive colors from either `colormap`, `color_type` or `color` inputs.

    Get a list of colors either from `colormap`, or from `color`,
    or from `color_type` (if both `colormap` and `color` are None).

    Parameters
    ----------
    color : str or sequence, optional
        Color(s) to be used for deriving sequence of colors.
        Can be either be a single color (single color string, or sequence of floats
        representing a single color), or a sequence of colors.
    colormap : :py:class:`matplotlib.colors.Colormap`, optional
        Matplotlib colormap.
        When provided, the resulting colors will be derived from the colormap.
    color_type : {"default", "random"}, optional
        Type of colors to derive. Used if provided `color` and `colormap` are None.
        Ignored if either `color` or `colormap`` are not None.
    num_colors : int
        Number of colors to be extracted.

    Returns
    -------
    list
        List of colors extracted.

    Warns
    -----
    UserWarning
        If both `colormap` and `color` are provided.
        Parameter `color` will override.
    Nr(   zC'color' and 'colormap' cannot be used simultaneously. Using 'color')Ú
stacklevel)Ú_get_colors_from_colormapÚwarningsÚwarnr   Ú_get_colors_from_colorÚ_get_colors_from_color_typer'   s       r   r+   r+   o   sv   € ðN €}˜Ð-Ý(¨¸jÐIÑIÔIÐIØ	Ð	ØÐÝŒMØUÝ+Ñ-Ô-ðñ ô ð õ & eÑ,Ô,Ð,å*¨:À*ÐMÑMÔMÐMr   r.   úIterator[Color]c              #  óž   K  — t          |t          | ¦  «        ¦  «        }t          j        t          j        | ¦  «        |¦  «        E d{V —† dS )zÈCycle colors until achieving max of `num_colors` or length of `colors`.

    Extra colors will be ignored by matplotlib if there are more colors
    than needed and nothing needs to be done here.
    N)ÚmaxÚlenÚ	itertoolsÚisliceÚcycle)r.   r   Ú
max_colorss      r   r-   r-   £   sR   è è € õ �Z¥ V¡¤Ñ-Ô-€JÝÔ¥	¤°Ñ 7Ô 7¸ÑDÔDÐDÐDÐDÐDÐDÐDÐDÐDÐDr   ústr | Colormapc                óh   ‡— t          | ¦  «        Šˆfd„t          j        dd|¬¦  «        D ¦   «         S )zGet colors from colormap.c                ó&   •— g | ]} ‰|¦  «        ‘ŒS r   r   )Ú.0ÚnumÚcmaps     €r   ú
<listcomp>z-_get_colors_from_colormap.<locals>.<listcomp>³   s!   ø€ ÐCÐCÐC˜#ˆDˆD�‰IŒIÐCÐCÐCr   r   é   )rD   )Ú_get_cmap_instanceÚnpÚlinspace)r   r   rE   s     @r   r3   r3   ­   s=   ø€ õ
 ˜hÑ'Ô'€DØCÐCÐCÐC¥¤¨Q°°zÐ!BÑ!BÔ!BÐCÑCÔCÐCr   r   c                ó‚   — t          | t          ¦  «        r)| }t          j        |          } | €t	          d|› d�¦  «        ‚| S )z$Get instance of matplotlib colormap.Nz	Colormap z is not recognized)r)   r   ÚmplÚ	colormapsÚ
ValueError)r   rE   s     r   rH   rH   ¶   sK   € å�(�CÑ Ô ð CØˆÝ”= Ô*ˆØÐÝÐA¨ÐAÐAÐAÑBÔBÐBØ€Or   úColor | Collection[Color]c                ó  — t          | ¦  «        dk    rt          d| › �¦  «        ‚t          | ¦  «        rt          t          | ¦  «        } | gS t          t
          t                   | ¦  «        } t          t          | ¦  «        ¦  «        S )z!Get colors from user input color.r   zInvalid color argument: )r;   rN   Ú_is_single_colorr   ÚColorr   r,   Ú!_gen_list_of_colors_from_iterabler   s    r   r6   r6   À   s{   € õ ˆ5�z„z�Q‚€ÝÐ;°EÐ;Ð;Ñ<Ô<Ð<å˜ÑÔð Ý•U˜EÑ"Ô"ˆØˆwˆå•�EÔ" EÑ*Ô*€EÝÕ1°%Ñ8Ô8Ñ9Ô9Ð9r   Úboolc                ót   — t          | t          ¦  «        rt          | ¦  «        rdS t          | ¦  «        rdS dS )a0  Check if `color` is a single color, not a sequence of colors.

    Single color is of these kinds:
        - Named color "red", "C0", "firebrick"
        - Alias "g"
        - Sequence of floats, such as (0.1, 0.2, 0.3) or (0.1, 0.2, 0.3, 0.4).

    See Also
    --------
    _is_single_string_color
    TF)r)   r   Ú_is_single_string_colorÚ_is_floats_colorr   s    r   rQ   rQ   Ï   sE   € õ �%�ÑÔð Õ"9¸%Ñ"@Ô"@ð àˆtå˜ÑÔð Øˆtàˆ5r   úCollection[Color]c              #  ó^   K  — | D ]'}t          |¦  «        r|V — Œt          d|› �¦  «        ‚dS )zS
    Yield colors from string of several letters or from collection of colors.
    zInvalid color N)rQ   rN   )r   Úxs     r   rS   rS   å   sS   è è € ð ð 3ð 3ˆÝ˜AÑÔð 	3ØˆGˆGˆGˆGåÐ1¨aÐ1Ð1Ñ2Ô2Ð2ð	3ð 3r   c                ó¸   — t          t          | ¦  «        o>t          | ¦  «        dk    pt          | ¦  «        dk    ot          d„ | D ¦   «         ¦  «        ¦  «        S )zACheck if color comprises a sequence of floats representing color.é   é   c              3  óN   K  — | ] }t          |t          t          f¦  «        V — Œ!d S r   )r)   r   Úfloat)rC   rZ   s     r   ú	<genexpr>z#_is_floats_color.<locals>.<genexpr>õ   s0   è è € Ð;Ð;°•
˜1�s¥E˜lÑ+Ô+Ð;Ð;Ð;Ð;Ð;Ð;r   )rT   r   r;   Úallr   s    r   rW   rW   ð   s_   € åÝ�UÑÔð 	<Ý�‰ZŒZ˜1Š_Ð/¥ E¡
¤
¨a¢ð	<åÐ;Ð;°UÐ;Ñ;Ô;Ñ;Ô;ñô ð r   c           
     ó\  — | dk    rLt           j        d         }d„ t          j        |t	          |t          |¦  «        ¦  «        ¦  «        D ¦   «         S | dk    rFt          j                             |¦  «                             |df¦  «         	                    ¦   «         S t          d¦  «        ‚)z&Get colors from user input color type.r%   zaxes.prop_cyclec                ó   — g | ]
}|d          ‘ŒS r   r   )rC   Úcs     r   rF   z/_get_colors_from_color_type.<locals>.<listcomp>ý   s,   € ð 
ð 
ð 
àð ˆgŒJð
ð 
ð 
r   Úrandomr\   z/color_type must be either 'default' or 'random')rL   ÚrcParamsr<   r=   Úminr;   rI   re   Údefault_rngÚtolistrN   )r   r   Ú
prop_cycles      r   r7   r7   ù   s¨   € à�YÒÐÝ”\Ð"3Ô4ˆ
ð
ð 
åÔ% jµ#°jÅ#ÀjÁ/Ä/Ñ2RÔ2RÑSÔSð
ñ 
ô 
ð 	
ð 
�xÒ	Ð	ÝŒy×$Ò$ ZÑ0Ô0×7Ò7¸ÀQ¸ÑHÔH×OÒOÑQÔQÐQåÐJÑKÔKÐKr   rR   c                ó�   — t           j                             ¦   «         }	 |                     | ¦  «         dS # t          $ r Y dS w xY w)aƒ  Check if `color` is a single string color.

    Examples of single string colors:
        - 'r'
        - 'g'
        - 'red'
        - 'green'
        - 'C3'
        - 'firebrick'

    Parameters
    ----------
    color : Color
        Color string or sequence of floats.

    Returns
    -------
    bool
        True if `color` looks like a valid color.
        False otherwise.
    TF)Ú
matplotlibr.   ÚColorConverterÚto_rgbarN   )r   Úconvs     r   rV   rV     s\   € õ, Ô×+Ò+Ñ-Ô-€Dðð 	�Š�UÑÔÐð ˆtøõ ð ð ð Øˆuˆuðøøøs    7 ·
AÁA)..)
r   r   r   r   r   r   r   r   r   r   )
r   r   r   r   r   r   r   r   r   r    )
r   r   r   r   r   r   r   r"   r   r#   )Nr%   )
r   r/   r   r0   r   r   r   r   r   r    )r.   r    r   r   r   r8   )r   r@   r   r   r   r    )r   r@   r   r   )r   rO   r   r    )r   rO   r   rT   )r   rX   r   r8   )r   r   r   r   r   r    )r   rR   r   rT   )$Ú
__future__r   Úcollections.abcr   r   r   r<   Útypingr   r   r	   r4   rl   rL   Úmatplotlib.colorsÚnumpyrI   Úpandas._typingr
   rR   Úpandas.util._exceptionsr   Úpandas.core.dtypes.commonr   r   r   r+   r-   r3   rH   r6   rQ   rS   rW   r7   rV   r   r   r   ú<module>rx      sÅ  ðØ "Ð "Ð "Ð "Ð "Ð "ðð ð ð ð ð ð ð ð ð ð
 Ð Ð Ð ðð ð ð ð ð ð ð ð ð ð
 €€€à Ð Ð Ð Ø Ð Ð Ð Ø Ð Ð Ð à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4à 2Ð 2Ð 2Ð 2Ð 2Ð 2àð +Ø*Ð*Ð*Ð*Ð*Ð*ð 
ð !$Øðð ð ð ñ 
„ðð 
ð !$Øðð
 -0ðð ð ð ð ñ 
„ðð 
ð !$Øð)ð
 @Cð)ð )ð )ð )ð )ñ 
„ð)ð !%Øð1>ð
 @Dð1>ð 1>ð 1>ð 1>ð 1>ð 1>ðh1Nð 1Nð 1Nð 1NðhEð Eð Eð EðDð Dð Dð Dðð ð ð ð:ð :ð :ð :ðð ð ð ð,3ð 3ð 3ð 3ðð ð ð ðLð Lð Lð Lðð ð ð ð ð r   