
    Pi{                    ~    d dl mZ d dlmZ d dlZd dlmZ erd dlmZ  ed           G d d                      Z	dS )	    )annotations)TYPE_CHECKINGN)
set_module)NDFramepandasc                      e Zd ZU dZdhZded<   dd
Zedd            Zej	        dd            ZddZ
ddZddZddZdS )Flagsu  
    Flags that apply to pandas objects.

    “Flags” differ from “metadata”. Flags reflect properties of the pandas
    object (the Series or DataFrame). Metadata refer to properties of the
    dataset, and should be stored in DataFrame.attrs.

    Parameters
    ----------
    obj : Series or DataFrame
        The object these flags are associated with.
    allows_duplicate_labels : bool, default True
        Whether to allow duplicate labels in this object. By default,
        duplicate labels are permitted. Setting this to ``False`` will
        cause an :class:`errors.DuplicateLabelError` to be raised when
        `index` (or columns for DataFrame) is not unique, or any
        subsequent operation on introduces duplicates.
        See :ref:`duplicates.disallow` for more.

        .. warning::

           This is an experimental feature. Currently, many methods fail to
           propagate the ``allows_duplicate_labels`` value. In future versions
           it is expected that every method taking or returning one or more
           DataFrame or Series objects will propagate ``allows_duplicate_labels``.

    See Also
    --------
    DataFrame.attrs : Dictionary of global attributes of this dataset.
    Series.attrs : Dictionary of global attributes of this dataset.

    Examples
    --------
    Attributes can be set in two ways:

    >>> df = pd.DataFrame()
    >>> df.flags
    <Flags(allows_duplicate_labels=True)>
    >>> df.flags.allows_duplicate_labels = False
    >>> df.flags
    <Flags(allows_duplicate_labels=False)>

    >>> df.flags["allows_duplicate_labels"] = True
    >>> df.flags
    <Flags(allows_duplicate_labels=True)>
    allows_duplicate_labelszset[str]_keysobjr   boolreturnNonec               F    || _         t          j        |          | _        d S N)_allows_duplicate_labelsweakrefref_obj)selfr   r
   s      e/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/pandas/core/flags.py__init__zFlags.__init__?   s    (?%K$$			    c                    | j         S )a  
        Whether this object allows duplicate labels.

        Setting ``allows_duplicate_labels=False`` ensures that the
        index (and columns of a DataFrame) are unique. Most methods
        that accept and return a Series or DataFrame will propagate
        the value of ``allows_duplicate_labels``.

        See :ref:`duplicates` for more.

        See Also
        --------
        DataFrame.attrs : Set global metadata on this object.
        DataFrame.set_flags : Set global flags on this object.

        Examples
        --------
        >>> df = pd.DataFrame({"A": [1, 2]}, index=["a", "a"])
        >>> df.flags.allows_duplicate_labels
        True
        >>> df.flags.allows_duplicate_labels = False
        Traceback (most recent call last):
            ...
        pandas.errors.DuplicateLabelError: Index has duplicates.
              positions
        label
        a        [0, 1]
        )r   r   s    r   r
   zFlags.allows_duplicate_labelsC   s    < ,,r   valuec                    t          |          }|                                 }|t          d          |s|j        D ]}|                                 || _        d S )Nz$This flag's object has been deleted.)r   r   
ValueErroraxes_maybe_check_uniquer   )r   r   r   axs       r   r
   zFlags.allows_duplicate_labelsc   sj    Uiikk;CDDD 	)h ) )&&(((((-%%%r   keystrc                R    || j         vrt          |          t          | |          S r   )r   KeyErrorgetattr)r   r"   s     r   __getitem__zFlags.__getitem__p   s+    dj  3--tS!!!r   c                n    || j         vrt          d| d| j                    t          | ||           d S )NzUnknown flag z. Must be one of )r   r   setattr)r   r"   r   s      r   __setitem__zFlags.__setitem__v   sH    dj  OSOO4:OOPPPc5!!!!!r   c                    d| j          dS )Nz<Flags(allows_duplicate_labels=z)>)r
   r   s    r   __repr__zFlags.__repr__{   s    Q1MQQQQr   otherobjectc                `    t          |t          |                     r| j        |j        k    S dS )NF)
isinstancetyper
   )r   r-   s     r   __eq__zFlags.__eq__~   s1    eT$ZZ(( 	Q/53PPPur   N)r   r   r
   r   r   r   )r   r   )r   r   r   r   )r"   r#   )r"   r#   r   r   )r   r#   )r-   r.   r   r   )__name__
__module____qualname____doc__r   __annotations__r   propertyr
   setterr'   r*   r,   r2    r   r   r	   r	      s         - -^ 11E1111% % % % - - - X-> #
. 
. 
. $#
." " " "" " " "
R R R R     r   r	   )

__future__r   typingr   r   pandas.util._decoratorsr   pandas.core.genericr   r	   r:   r   r   <module>r?      s    " " " " " "              . . . . . . ,++++++ Ht t t t t t t t t tr   