
    A>i{                    t    S SK Jr  S SKJr  S SKrS SKJr  \(       a  S SKJr  \" S5       " S S5      5       r	g)	    )annotations)TYPE_CHECKINGN)
set_module)NDFramepandasc                      \ 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   u  
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]_keysc               F    X l         [        R                  " U5      U l        g N)_allows_duplicate_labelsweakrefref_obj)selfobjr   s      P/var/www/html/land-tabula/venv/lib/python3.13/site-packages/pandas/core/flags.py__init__Flags.__init__?   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_labelsC   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   c   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__p   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__v   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__{   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__~   s-    eT$Z((//53P3PPPr   )r   r   N)r   r   r   r   returnNone)r6   r   )r!   r   r6   r7   )r&   str)r&   r8   r6   r7   )r6   r8   )r3   objectr6   r   )__name__
__module____qualname____firstlineno____doc__r   __annotations__r   propertyr   setterr'   r+   r.   r4   __static_attributes__ r   r   r	   r	      s_    -^ 11E81% - -> ##
. $
.""
Rr   r	   )

__future__r   typingr   r   pandas.util._decoratorsr   pandas.core.genericr   r	   rC   r   r   <module>rH      s8    "    .+ Ht t tr   