Ë
    u™ãjÓM  ã                  óþ  — d Z ddlmZ ddlZddlmZmZ ddlZddlZddl	m
Z
 ddlZddlZddlmZmZmZmZmZmZ ddlZddlmZ ddlmZ dd	lmZmZ dd
lmZmZm Z m!Z!m"Z" ddl#m$Z$ ddl%m&Z& er0ddl'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z- ddl.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4 ddl5m6Z6m7Z7m8Z8 ddl9m:Z: dEd„Z;dFd„Z<dGd„Z=dHd„Z>dId„Z?dJd„Z@dJd„ZAdJd„ZBdJd„ZCdKd„ZDe	 dL	 	 	 	 	 dMd„«       ZEedLdNd„«       ZEdOdNd„ZE	 dO	 	 	 	 	 dPd„ZFdQd„ZGdRd „ZHdSd!„ZIdSd"„ZJdTd#„ZKdUd$„ZLdVd%„ZMdWd&„ZNdXd'„ZOedYd(„«       ZPe	 	 	 	 dZd)„«       ZP	 dO	 	 	 d[d*„ZP ed+«      ZQe	 	 	 	 	 	 	 	 	 	 d\d,„«       ZRe	 	 	 	 	 	 	 	 	 	 d]d-„«       ZR	 	 	 	 	 	 	 	 	 	 d^d.„ZRd_d/„ZS	 	 	 	 d`d0„ZTejª                  	 da	 	 	 	 	 	 	 	 	 dbd1„«       ZVdcd2„ZWi ej°                  d3“ej²                  d4“ej´                  d5“ej¶                  d6“ej¸                  d7“ej°                  d3“ejº                  d3“ej¼                  d8“ej¾                  d8“ejÀ                  d9“ejÂ                  d9“ejÄ                  d:“ejÆ                  d:“ejÈ                  d;“ejÊ                  d;“ejÌ                  d<“ejÎ                  d<“ej²                  d4ejÐ                  d4ej´                  d5ejÒ                  d5ejÔ                  d=ejÖ                  d=ejØ                  d>ejÚ                  d>i¥Znddd?„Zoded@„Zp eqdA„ dBD «       «      ZrdfdC„ZsdgdD„Zty)hzh
Misc tools for implementing data structures

Note: pandas.core.common is *not* part of the public API.
é    )ÚannotationsN)ÚabcÚdefaultdict)Úpartial)ÚTYPE_CHECKINGÚAnyÚConcatenateÚTypeVarÚcastÚoverload)Úlib)Ú'construct_1d_object_array_from_listlike)Úis_bool_dtypeÚ
is_integer)ÚABCExtensionArrayÚABCIndexÚABCMultiIndexÚABCNumpyExtensionArrayÚ	ABCSeries)Úiterable_not_string)Ú
Expression)ÚCallableÚ
CollectionÚ	GeneratorÚHashableÚIterableÚSequence)ÚAnyArrayLikeÚ	ArrayLikeÚNpDtypeÚPÚRandomStateÚT)Ú	DataFrameÚIndexÚSeries)ÚNDFramec              #  ód   K  — | D ]%  }t        |«      rt        |«      E d{  –—†  Œ"|–— Œ' y7 Œ­w)a  
    Flatten an arbitrarily nested sequence.

    Parameters
    ----------
    line : sequence
        The non string sequence to flatten

    Notes
    -----
    This doesn't consider strings sequences.

    Returns
    -------
    flattened : generator
    N)r   Úflatten)ÚlineÚelements     ú]/var/www/html/python-recuperauto-other/env/lib/python3.12/site-packages/pandas/core/common.pyr)   r)   K   s5   è ø€ ð" ò ˆÜ˜wÔ'Ü˜wÓ'×'Ñ'à‹Mñ	à'ús   ‚0¡.¢0c                óˆ   — | d   j                   }| dd  D ]  }	 |j                   |k7  rd } |S Œ |S # t        $ r d }Y  |S w xY w)Nr   é   )ÚnameÚ
ValueError)Úobjsr/   Úobjs      r,   Úconsensus_name_attrr3   c   sn   € Ø�‰7�<‰<€DØ�A�Bˆxò ˆð	Ø�x‰x˜4ÒØ�Øð €Kð  ðð €Køô ò 	ØˆDÙØ€Kð	ús   ™1±AÁ Ac                ó(  — t        | t        t        j                  t        t
        t        f«      r”t        | t        «      s„| j                  t        j                  k(  rPt        j                  | «      }t        j                  |«      s%d}t        j                  |d¬«      rt        |«      ‚yyt        | j                  «      ryyt        | t        «      r?t!        | «      dkD  r1t#        | «      t        urt        | «      } t        j$                  | «      S y)aË  
    Check whether `key` is a valid boolean indexer.

    Parameters
    ----------
    key : Any
        Only list-likes may be considered boolean indexers.
        All other types are not considered a boolean indexer.
        For array-like input, boolean ndarrays or ExtensionArrays
        with ``_is_boolean`` set are considered boolean indexers.

    Returns
    -------
    bool
        Whether `key` is a valid boolean indexer.

    Raises
    ------
    ValueError
        When the array is an object-dtype ndarray or ExtensionArray
        and contains missing values.

    See Also
    --------
    check_array_indexer : Check that `key` is a valid array to index,
        and convert to an ndarray.
    z=Cannot mask with non-boolean array containing NA / NaN valuesT)ÚskipnaFr   )Ú
isinstancer   ÚnpÚndarrayr   r   r   r   ÚdtypeÚobject_Úasarrayr   Úis_bool_arrayr0   r   ÚlistÚlenÚtypeÚis_bool_list)ÚkeyÚ	key_arrayÚna_msgs      r,   Úis_bool_indexerrD   p   sÖ   € ô8 ØÜ	”B—J‘J¤Ô*;Ô=SÐTôô ˜œmÔ,Ø�9‰9œŸ
™
Ò"ÜŸ
™
 3›ˆIä×$Ñ$ YÔ/ØX�Ü×$Ñ$ Y°tÕ<ô % VÓ,Ð,ØØÜ˜3Ÿ9™9Ô%Øð ô 
�CœÔ	äˆs‹8�aŠ<Ü�C‹y¤Ñ$ä˜3“i�Ü×#Ñ# CÓ(Ð(àó    c                óf   — t        j                  | «      r| j                  «       rt        d«      ‚| S )z®
    Disallow indexing with a float key, even if that key is a round number.

    Parameters
    ----------
    val : scalar

    Returns
    -------
    outval : scalar
    zYIndexing with a float is no longer supported. Manually convert to an integer key instead.)r   Úis_floatr   Ú
IndexError)Úvals    r,   Úcast_scalar_indexerrJ   ¨   s2   € ô ‡|�|�CÔ˜SŸ^™^Ô-Üð)ó
ð 	
ð
 €JrE   c                 ó   — d„ | D «       S )zL
    Returns a generator consisting of the arguments that are not None.
    c              3  ó&   K  — | ]	  }|€Œ|–— Œ y ­w©N© ©Ú.0Úargs     r,   ú	<genexpr>znot_none.<locals>.<genexpr>Â   s   è ø€ Ò3�C 3¡?ŒCÑ3ùs   ‚ŠrN   ©Úargss    r,   Únot_nonerU   ¾   s   € ñ 4˜4Ô3Ð3rE   c                 ó&   — t        d„ | D «       «      S )z?
    Returns a boolean indicating if any argument is None.
    c              3  ó$   K  — | ]  }|d u –— Œ
 y ­wrM   rN   rO   s     r,   rR   zany_none.<locals>.<genexpr>É   ó   è ø€ Ò+˜sˆs�dŒ{Ñ+ùó   ‚©ÚanyrS   s    r,   Úany_noner\   Å   ó   € ô Ñ+ dÔ+Ó+Ð+rE   c                 ó&   — t        d„ | D «       «      S )zA
    Returns a boolean indicating if all arguments are None.
    c              3  ó$   K  — | ]  }|d u –— Œ
 y ­wrM   rN   rO   s     r,   rR   zall_none.<locals>.<genexpr>Ð   rX   rY   ©ÚallrS   s    r,   Úall_nonerb   Ì   r]   rE   c                 ó&   — t        d„ | D «       «      S )zC
    Returns a boolean indicating if any argument is not None.
    c              3  ó$   K  — | ]  }|d u–— Œ
 y ­wrM   rN   rO   s     r,   rR   zany_not_none.<locals>.<genexpr>×   ó   è ø€ Ò/ 3ˆs˜$ŒÑ/ùrY   rZ   rS   s    r,   Úany_not_nonerf   Ó   ó   € ô Ñ/¨$Ô/Ó/Ð/rE   c                 ó&   — t        d„ | D «       «      S )zE
    Returns a boolean indicating if all arguments are not None.
    c              3  ó$   K  — | ]  }|d u–— Œ
 y ­wrM   rN   rO   s     r,   rR   zall_not_none.<locals>.<genexpr>Þ   re   rY   r`   rS   s    r,   Úall_not_nonerj   Ú   rg   rE   c                 ó&   — t        d„ | D «       «      S )z;
    Returns the count of arguments that are not None.
    c              3  ó$   K  — | ]  }|d u–— Œ
 y ­wrM   rN   )rP   Úxs     r,   rR   z!count_not_none.<locals>.<genexpr>å   s   è ø€ Ò+ ˆq˜Œ}Ñ+ùrY   )ÚsumrS   s    r,   Úcount_not_nonero   á   r]   rE   c                 ó   — y rM   rN   ©Úvaluesr9   s     r,   Úasarray_tuplesafers   è   s   € ð rE   c                 ó   — y rM   rN   rq   s     r,   rs   rs   ò   s   € ØSVrE   c                óˆ  — t        | t        t        f«      st        | d«      st        | «      } n8t        | t        «      r| j
                  S t        | t        «      r| j
                  S t        | t        «      r#|t        j                  t        fv rt        | «      S 	 t        j                  | |¬«      }t        |j                  j                  t         «      rt        j                  | t        ¬«      }|j"                  dk(  r#| D �cg c]  }t        |«      ‘Œ } }t        | «      }|S # t        $ r t        | «      cY S w xY wc c}w )NÚ	__array__©r9   é   )r6   r=   ÚtupleÚhasattrr   Ú_valuesr   r7   r:   Úobjectr   r;   r0   Ú
issubclassr9   r?   ÚstrÚndim)rr   r9   Úresultrm   s       r,   rs   rs   ö   sþ   € Ü�v¤¤e˜}Ô-´¸ÀÔ1MÜ�f“‰Ü	�FœHÔ	%Ø�~‰~ÐÜ	�FœIÔ	&Ø�~‰~Ðä�&œ$Ô E¬b¯j©j¼&Ð-AÑ$AÜ6°vÓ>Ð>ð?Ü—‘˜F¨%Ô0ˆô �&—,‘,×#Ñ#¤SÔ)Ü—‘˜F¬&Ô1ˆà‡{�{�aÒà$*Ö+˜q”%˜•(Ð+ˆÐ+Ü8¸Ó@ˆà€Møô ò ?ô
 7°vÓ>Ò>ð?üò ,s   ÂD% ÄD?Ä%D<Ä;D<c                óÎ   — t        | t        t        f«      r| g} t        | t        t        j
                  f«      s	 t        | «      } t        | |¬«      }|S # t        $ r | g} Y Œw xY w)zë
    Transform label or iterable of labels to array, for use in Index.

    Parameters
    ----------
    dtype : dtype
        If specified, use as dtype of the resulting array, otherwise infer.

    Returns
    -------
    array
    rw   )r6   r~   ry   r=   r7   r8   Ú	TypeErrorrs   )Úlabelsr9   Úrlabelss      r,   Úindex_labels_to_arrayr…     se   € ô �&œ3¤˜,Ô'Ø�ˆä�fœt¤R§Z¡ZÐ0Ô1ð	Ü˜&“\ˆFô   ¨eÔ4€Gà€Nøô ò 	Ø�XŠFð	ús   »A ÁA$Á#A$c                ó<   — | �t        | t        t        f«      s| gS | S rM   )r6   ry   r=   ©r2   s    r,   Úmaybe_make_listrˆ   2  s    € Ø
€œz¨#´´t¨}Ô=ØˆuˆØ€JrE   c                óœ   — t        | t        j                  «      r%t        | t        j                  «      st	        | «      S t        d| «      } | S )zB
    If obj is Iterable but not list-like, consume into list.
    r   )r6   r   r   ÚSizedr=   r   r‡   s    r,   Úmaybe_iterable_to_listr‹   8  s:   € ô �#”s—|‘|Ô$¬Z¸¼S¿Y¹YÔ-GÜ�C‹yÐÜ
ˆ|˜SÓ
!€CØ€JrE   c                ó‚   — t        | t        «      xr. | j                  du xr | j                  du xr | j                  du S )z
    We have a null slice.
    N©r6   ÚsliceÚstartÚstopÚstepr‡   s    r,   Úis_null_slicer’   B  sH   € ô
 	�3œÓò 	Ø�I‰I˜Ðò	à�H‰H˜Ðò	ð �H‰H˜Ðð	rE   c                ó˜   — t        | t        «      xr9 | j                  duxr) | j                  duxr | j                  | j                  k(  S )z>
    We have an empty slice, e.g. no values are selected.
    N)r6   rŽ   r�   r�   r‡   s    r,   Úis_empty_slicer”   N  sL   € ô
 	�3œÓò 	"Ø�I‰I˜TÐ!ò	"à�H‰H˜DÐ ò	"ð �I‰I˜Ÿ™Ñ!ð	rE   c              #  óZ   K  — | D ]"  }t        |t        «      xr t        |«       –— Œ$ y­w)z;
    Find non-trivial slices in "line": yields a bool.
    N)r6   rŽ   r’   )r*   Úks     r,   Úis_true_slicesr—   Z  s1   è ø€ ð ò <ˆÜ˜œEÓ"Ò;¬=¸Ó+;Ð';Ó;ñ<ùs   ‚)+c                ó†   — t        | t        «      xr0 | j                  dk(  xr | j                  |k(  xr | j                  du S )z&
    We have a full length slice.
    r   Nr�   )r2   r*   s     r,   Úis_full_slicer™   c  sG   € ô
 	�3œÓò 	Ø�I‰I˜‰Nò	à�H‰H˜Ñò	ð �H‰H˜Ðð	rE   c                ó¾   — t        | d«      r| j                  S t        | t        «      rt	        | j
                  «      S t        | «      rt        | «      j                  S y )NÚ__name__)rz   r›   r6   r   Úget_callable_nameÚfuncÚcallabler?   r‡   s    r,   rœ   rœ   o  sK   € äˆs�JÔØ�|‰|Ðä�#”wÔÜ  §¡Ó*Ð*ä�„}Ü�C‹y×!Ñ!Ð!ð
 rE   c                ót   — t        | t        «      r | j                  |fi |¤ŽS t        | «      r	 | |fi |¤ŽS | S )zØ
    Evaluate possibly callable input using obj and kwargs if it is callable,
    otherwise return as it is.

    Parameters
    ----------
    maybe_callable : possibly a callable
    obj : NDFrame
    **kwargs
    )r6   r   Ú_eval_expressionrž   )Úmaybe_callabler2   Úkwargss      r,   Úapply_if_callabler£   €  sD   € ô �.¤*Ô-Ø.ˆ~×.Ñ.¨sÑ=°fÑ=Ð=Ü	�.Ô	!Ù˜cÑ, VÑ,Ð,àÐrE   c                ó  — t        j                  | «      s5t        | t        «      rt	        t        | j
                  «      S t        | «      } t        | t        j                  «      st        d| › �«      ‚| t        k(  rt        d«      ‚| S )a  
    Helper function to standardize a supplied mapping.

    Parameters
    ----------
    into : instance or subclass of collections.abc.Mapping
        Must be a class, an initialized collections.defaultdict,
        or an instance of a collections.abc.Mapping subclass.

    Returns
    -------
    mapping : a collections.abc.Mapping subclass or other constructor
        a callable object that can accept an iterator to create
        the desired Mapping.

    See Also
    --------
    DataFrame.to_dict
    Series.to_dict
    zunsupported type: z/to_dict() only accepts initialized defaultdicts)ÚinspectÚisclassr6   r   r   Údefault_factoryr?   r}   r   ÚMappingr‚   )Úintos    r,   Ústandardize_mappingrª   “  sp   € ô* �?‰?˜4Ô Ü�dœKÔ(Üœ;¨×(<Ñ(<Ó=Ð=Ü�D‹zˆÜ�dœCŸK™KÔ(ÜÐ,¨T¨FÐ3Ó4Ð4ØŒ{ÒÜÐIÓJÐJØ€KrE   c                 ó   — y rM   rN   ©Ústates    r,   Úrandom_stater®   ³  s   € ØEHrE   c                 ó   — y rM   rN   r¬   s    r,   r®   r®   ·  s   € ð  rE   c                ó�  — t        | «      s4t        | t        j                  t        j                  j
                  f«      rt        j                  j                  | «      S t        | t        j                  j                  «      r| S t        | t        j                  j                  «      r| S | €t        j                  S t        d«      ‚)aq  
    Helper function for processing random_state arguments.

    Parameters
    ----------
    state : int, array-like, BitGenerator, Generator, np.random.RandomState, None.
        If receives an int, array-like, or BitGenerator, passes to
        np.random.RandomState() as seed.
        If receives an np.random RandomState or Generator, just returns that unchanged.
        If receives `None`, returns np.random.
        If receives anything else, raises an informative ValueError.

        Default None.

    Returns
    -------
    np.random.RandomState or np.random.Generator. If state is None, returns np.random

    zdrandom_state must be an integer, array-like, a BitGenerator, Generator, a numpy RandomState, or None)	r   r6   r7   r8   ÚrandomÚBitGeneratorr"   r   r0   r¬   s    r,   r®   r®   ½  s�   € ô, �%ÔœJ u¬r¯z©z¼2¿9¹9×;QÑ;QÐ.RÔSÜ�y‰y×$Ñ$ UÓ+Ð+Ü	�Eœ2Ÿ9™9×0Ñ0Ô	1ØˆÜ	�Eœ2Ÿ9™9×.Ñ.Ô	/ØˆØ	ˆÜ�y‰yÐäð+ó
ð 	
rE   Ú_Tc                 ó   — y rM   rN   ©r2   r�   rT   r¢   s       r,   Úpiper¶   å  ó   € ð 	rE   c                 ó   — y rM   rN   rµ   s       r,   r¶   r¶   î  r·   rE   c                ó†   — t        |t        «      r&|\  }}||v r|› d�}t        |«      ‚| ||<    ||i |¤ŽS  || g|¢­i |¤ŽS )as  
    Apply a function ``func`` to object ``obj`` either by passing obj as the
    first argument to the function or, in the case that the func is a tuple,
    interpret the first element of the tuple as a function and pass the obj to
    that function as a keyword argument whose key is the value of the second
    element of the tuple.

    Parameters
    ----------
    func : callable or tuple of (callable, str)
        Function to apply to this object or, alternatively, a
        ``(callable, data_keyword)`` tuple where ``data_keyword`` is a
        string indicating the keyword of ``callable`` that expects the
        object.
    *args : iterable, optional
        Positional arguments passed into ``func``.
    **kwargs : dict, optional
        A dictionary of keyword arguments passed into ``func``.

    Returns
    -------
    object : the return type of ``func``.
    z/ is both the pipe target and a keyword argument)r6   ry   r0   )r2   r�   rT   r¢   Úfunc_ÚtargetÚmsgs          r,   r¶   r¶   ÷  sd   € ô: �$œÔà‰ˆˆvØ�VÑØ�HÐKÐLˆCÜ˜S“/Ð!Øˆˆv‰Ù�dÐ%˜fÑ%Ð%á�CÐ)˜$Ò) &Ñ)Ð)rE   c                óX   ‡ — dˆ fd„}t        ‰ t        j                  t        f«      r|S ‰ S )zv
    Returns a function that will map names/labels, dependent if mapper
    is a dict, Series or just a function.
    c                ó   •— | ‰v r‰|    S | S rM   rN   )rm   Úmappers    €r,   Úfzget_rename_function.<locals>.f&  s   ø€ Ø�‰;Ø˜!‘9ÐàˆHrE   )rm   r   Úreturnr   )r6   r   r¨   r   )r¿   rÀ   s   ` r,   Úget_rename_functionrÂ      s'   ø€ õô ˜6¤C§K¡K´Ð#;Ô<ˆ1ÐHÀ&ÐHrE   c                óÔ   — t        | t        t        j                  t        t
        t        f«      r| S t        | t        j                  «      rt        | t        «      st        | «      S | gS )z¤
    Convert list-like or scalar input to list-like. List, numpy and pandas array-like
    inputs are returned unmodified whereas others are converted to list.
    )
r6   r=   r7   r8   r   r   r   r   r   r~   )rr   s    r,   Úconvert_to_list_likerÄ   /  sK   € ô �&œ4¤§¡¬X´yÔBSÐTÔUØˆÜ	�FœCŸL™LÔ	)´*¸VÄSÔ2IÜ�F‹|Ðàˆ8€OrE   c              #  ó–   K  — |rt        | |«      }t        | ||«       	 | –— |rt        | |«       yy# |rt        | |«       w w xY w­w)aØ  
    Temporarily set attribute on an object.

    Parameters
    ----------
    obj : object
        Object whose attribute will be modified.
    attr : str
        Attribute to modify.
    value : Any
        Value to temporarily set attribute to.
    condition : bool, default True
        Whether to set the attribute. Provided in order to not have to
        conditionally use this context manager.

    Yields
    ------
    object : obj with modified attribute.
    N)ÚgetattrÚsetattr)r2   ÚattrÚvalueÚ	conditionÚ	old_values        r,   Útemp_setattrrÌ   >  sU   è ø€ ñ. Ü˜C Ó&ˆ	Ü��T˜5Ô!ð*ØŠ	áÜ�C˜˜yÕ)ð ø‰9Ü�C˜˜yÕ)ð üs   ‚A	Ÿ4 £A	´AÁA	c                óz   — t        | «      t        |«      k7  r$t        dt        | «      › dt        |«      › d�«      ‚y)zC
    Check the length of data matches the length of the index.
    zLength of values (z") does not match length of index (ú)N)r>   r0   )ÚdataÚindexs     r,   Úrequire_length_matchrÑ   _  sI   € ô ˆ4ƒy”C˜“JÒÜðÜ�D“	ˆ{ð ä�E“
ˆ|˜1ðó
ð 	
ð rE   rn   ÚmaxÚminra   r[   ÚmeanÚprodÚstdÚvarÚmedianÚcumprodÚcumsumc                ó,   — t         j                  | «      S )zH
    if we define an internal function for this argument, return it
    )Ú_cython_tableÚget)rQ   s    r,   Úget_cython_funcrÞ   ‰  s   € ô ×Ñ˜SÓ!Ð!rE   c                óX   — t        | «      D ��cg c]  \  }}|€d|› �n|‘Œ c}}S c c}}w )a  
    If a name is missing then replace it by level_n, where n is the count

    Parameters
    ----------
    names : list-like
        list of column names or None values.

    Returns
    -------
    list
        list of column names with the None values replaced.
    Úlevel_)Ú	enumerate)ÚnamesÚir/   s      r,   Úfill_missing_namesrä   �  s2   € ô CLÈEÓBR×S±w°q¸$˜D˜Lˆf�Q�C‰L¨dÑ2ÓSÐSùÓSs   �&c              #  óh   K  — | ]*  }|t         j                  v sŒt         j                  |   –— Œ, y ­wrM   )ÚdisÚopmap)rP   r/   s     r,   rR   rR   ¤  s(   è ø€ ò ØÀ4Ì3Ï9É9ÒCT„C‡I�Iˆd…Oñùs   ‚2š2)ÚSTORE_SUBSCRÚSTORE_SLICEc                 óž   — 	 t        j                  d«      } | j                  j                  | j
                     t        v S # t        $ r Y yw xY w)a  
    Helper function used in detecting chained assignment.

    Whether the frame calling ``__setitem__`` is executing a subscript
    assignment (``obj[key] = value``) right now.

    The refcount check can only tell a temporary apart from a named object for
    calls coming from the interpreter, because it relies on the extra
    reference the interpreter holds on its value stack. Code compiled with
    Cython calls ``PyObject_SetItem`` directly, so it has one reference less
    and a perfectly valid ``df[col] = value`` there looks exactly like chained
    assignment (GH#51315). Such a call leaves no Python frame of its own, and
    the nearest Python frame is executing a call rather than a subscript
    assignment, so checking the opcode filters those out.
    rx   F)ÚsysÚ	_getframer0   Úf_codeÚco_codeÚf_lastiÚ_SETITEM_OPCODES)Úframes    r,   Ú!is_setitem_syntax_in_caller_framerò   ©  sJ   € ð Ü—‘˜aÓ ˆð �<‰<×Ñ §¡Ñ.Ô2BÐBÐBøô ò Ùðús   ‚A  Á 	AÁAc                óx   — t        j                  d«      }|j                  j                  «       D ]  }|| u sŒ y y)a…  
    Helper function used in detecting chained assignment.

    If the pandas object (DataFrame/Series) is a local variable
    in the caller's frame, it should not be a case of chained
    assignment or method call.

    For example:

    def test():
        df = pd.DataFrame(...)
        df["a"] = 1  # not chained assignment

    Inside ``df.__setitem__``, we call this function to check whether `df`
    (`self`) is a local variable in `test` frame (the frame calling setitem). If
    so, we know it is not a case of chained assignment (even when the refcount
    of `df` is below the threshold due to optimization of local variables).
    rx   TF)rë   rì   Úf_localsrr   )r2   rñ   Úvs      r,   Úis_local_in_caller_framerö   À  s=   € ô& �M‰M˜!Ó€EØ�^‰^×"Ñ"Ó$ò ˆØ�Š8Ùðð rE   )r*   r   rÁ   úGenerator[Any])r1   zlist[Series | DataFrame]rÁ   zHashable | None)rA   r   rÁ   Úbool)rI   r   rÁ   r   )rT   r|   rÁ   zGenerator[object])rT   r|   rÁ   rø   )rT   r|   rÁ   Úint).)rr   zArrayLike | list | tuple | zipr9   úNpDtype | NonerÁ   ú
np.ndarray)rr   r   r9   rú   rÁ   r   rM   )rƒ   znp.ndarray | Iterabler9   rú   rÁ   rû   )r2   r   rÁ   zlist | tuple | None)r2   zIterable[T] | TrÁ   zCollection[T] | T)r2   r|   rÁ   rø   )r*   zabc.IterablerÁ   zabc.Generator[bool, None, None])r2   r|   r*   rù   rÁ   rø   )r2   r|   rÁ   ú
str | None)r¡   r   r2   r   r¢   r   rÁ   r   )r©   ztype | abc.MappingrÁ   ztype | partial)r­   únp.random.GeneratorrÁ   rý   )r­   zHint | np.ndarray | np.random.BitGenerator | np.random.RandomState | NonerÁ   znp.random.RandomState)r­   zRandomState | NonerÁ   z+np.random.RandomState | np.random.Generator)
r2   r³   r�   zCallable[Concatenate[_T, P], T]rT   zP.argsr¢   zP.kwargsrÁ   r#   )
r2   r   r�   ztuple[Callable[..., T], str]rT   r   r¢   r   rÁ   r#   )
r2   r³   r�   z>Callable[Concatenate[_T, P], T] | tuple[Callable[..., T], str]rT   r   r¢   r   rÁ   r#   )r¿   r   rÁ   r   )rr   z"Hashable | Iterable | AnyArrayLikerÁ   zlist | AnyArrayLike)T)
r2   r   rÈ   r~   rÉ   r   rÊ   rø   rÁ   r÷   )rÏ   r   rÐ   r%   rÁ   ÚNone)rQ   r   rÁ   rü   )râ   zSequence[Hashable | None]rÁ   zlist[Hashable])rÁ   rø   )r2   r'   rÁ   rø   )uÚ__doc__Ú
__future__r   ÚbuiltinsÚcollectionsr   r   Ú
contextlibræ   Ú	functoolsr   r¥   rë   Útypingr   r   r	   r
   r   r   Únumpyr7   Úpandas._libsr   Úpandas.core.dtypes.castr   Úpandas.core.dtypes.commonr   r   Úpandas.core.dtypes.genericr   r   r   r   r   Úpandas.core.dtypes.inferencer   Úpandas.core.colr   Úcollections.abcr   r   r   r   r   r   Úpandas._typingr   r   r    r!   r"   r#   Úpandasr$   r%   r&   Úpandas.core.genericr'   r)   r3   rD   rJ   rU   r\   rb   rf   rj   ro   rs   r…   rˆ   r‹   r’   r”   r—   r™   rœ   r£   rª   r®   r³   r¶   rÂ   rÄ   ÚcontextmanagerrÌ   rÑ   rn   rÒ   rÓ   ra   r[   ÚnansumrÔ   ÚnanmeanrÕ   ÚnanprodrÖ   Únanstdr×   ÚnanvarrØ   Ú	nanmedianÚnanmaxÚnanminrÙ   Ú
nancumprodrÚ   Ú	nancumsumrÜ   rÞ   rä   Ú	frozensetrð   rò   rö   rN   rE   r,   ú<module>r     sM  ðñõ #ã ÷ó Û 
Ý Û Û 
÷÷ ó å å K÷÷õ õ =å &á÷÷ ÷÷ ÷ñ õ
 ,óó0
ó5ópó,4ó,ó,ó0ó0ó,ð 
àDGðØ*ðØ3Aðàòó 
ðð 
Û Vó 
Ø Vôð@ <@ðØ!ðØ*8ðàóó:óó	ó	ó<ó	óó"ó&ð@ 
Ú Hó 
Ø Hð 
ð ØSð àò ó 
ð ð !%ð"
Øð"
à0ó"
ñJ ˆTƒ]€ð 
ðØ	ðà
)ðð ðð ð	ð
 òó 
ðð 
ðØ	ðà
&ðð ðð ð	ð
 òó 
ðð&*Ø	ð&*à
Hð&*ð ð&*ð ð	&*ð
 ó&*óRIðØ.ðàóð ×Ñà7;ð*Ø	ð*Øð*Ø #ð*Ø04ð*àò*ó ð*ó@

ðØ‡L�L�%ðà‡L�L�%ðð ‡L�L�%ðð ‡F�FˆEð	ð
 ‡F�FˆEðð ‡F�FˆEðð ‡I�Iˆuðð ‡G�GˆVðð ‡J�J�ðð ‡G�GˆVðð ‡J�J�ðð ‡F�FˆEðð ‡I�Iˆuðð ‡F�FˆEðð ‡I�Iˆuðð  ‡I�Iˆxð!ð" ‡L�L�(ð#ð$ ‡F�FˆEØ‡I�IˆuØ‡F�FˆEØ‡I�IˆuØ‡J�J�	Ø‡M�M�9Ø‡I�IˆxØ‡L�L�(ñ3€ó:"óTñ( ñ Ø ?ôó Ð ó
Cô.rE   