
    Mh                    R    S SK Jr  S SKJr  S SKr\(       a  S SKJr   " S S5      rg)    )annotations)TYPE_CHECKINGN)NDFramec                      \ rS rSr% SrS1rS\S'   SS jr\SS j5       r	\	R                  SS j5       r	SS	 jrSS
 jrSS jrSS jrSrg)Flags
   a  
Flags that apply to pandas objects.

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``.

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]_keysc               F    X l         [        R                  " U5      U l        g N)_allows_duplicate_labelsweakrefref_obj)selfobjr	   s      C/var/www/html/env/lib/python3.13/site-packages/pandas/core/flags.py__init__Flags.__init__3   s    (?%KK$	    c                    U R                   $ )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	   Flags.allows_duplicate_labels7   s    < ,,,r   c                    [        U5      nU R                  5       nUc  [        S5      eU(       d#  UR                   H  nUR	                  5         M     Xl        g )Nz$This flag's object has been deleted.)boolr   
ValueErroraxes_maybe_check_uniquer   )r   valuer   axs       r   r	   r   W   sL    Uiik;CDDhh&&(  ).%r   c                L    XR                   ;  a  [        U5      e[        X5      $ r   )r
   KeyErrorgetattr)r   keys     r   __getitem__Flags.__getitem__d   s!    jj 3-t!!r   c                p    XR                   ;  a  [        SU SU R                    35      e[        XU5        g )NzUnknown flag z. Must be one of )r
   r   setattr)r   r$   r   s      r   __setitem__Flags.__setitem__j   s3    jj }SE1B4::,OPP5!r   c                "    SU R                    S3$ )Nz<Flags(allows_duplicate_labels=z)>)r	   r   s    r   __repr__Flags.__repr__o   s    01M1M0NbQQr   c                j    [        U[        U 5      5      (       a  U R                  UR                  :H  $ g)NF)
isinstancetyper	   )r   others     r   __eq__Flags.__eq__r   s-    eT$Z((//53P3PPPr   )r   r   N)r   r   r	   r   returnNone)r4   r   )r   r   r4   r5   )r$   str)r$   r6   r4   r5   )r4   r6   )__name__
__module____qualname____firstlineno____doc__r
   __annotations__r   propertyr	   setterr%   r)   r,   r2   __static_attributes__ r   r   r   r   
   s_    $L 11E81% - -> ##
. $
.""
Rr   r   )
__future__r   typingr   r   pandas.core.genericr   r   r@   r   r   <module>rD      s     "   +k kr   