
    :i                     d    d dl Zd dlmZ d dlmZmZ d dlmZ	 d dl
mZ d Zd Zd Zd Zd	 Zd
 Zy)    N)WARNING_CHECK_DISABLED)	DataFrameoption_context)	get_arrayc                 6   t        dg di      }|j                         }t        |d      }|d d  }|r1t        j                         5  |j                  dd       d d d        n|j                  dd       | rst        j                  t        |d      |      rJ |j                  j                  d      sJ |j                  j                  d      sJ t        j                  ||       y t        j                  t        |d      |      sJ y # 1 sw Y   xY wNag      ?      r   Tlowerinplacer   )r   copyr   tmassert_cow_warningclipnpshares_memory_mgr_has_no_referenceassert_frame_equal)using_copy_on_writewarn_copy_on_writedfdf_copyarr_aviews         f/var/www/html/talentspherev1.5.2/venv/lib/python3.12/site-packages/pandas/tests/copy_view/test_clip.pytest_clip_inplace_referencer       s    	C%	&BggiGb#Ea5D""$ 	+GG!TG*	+ 	+ 	a&##Ib#$6>>>ww((+++yy**1---
gt,	"c 2E:::	+ 	+s   DDc                 t   t        dg di      }|j                         }t        |d      }|d d  }|j                  dd       t	        j
                  t        |d      |      sJ | rQ|j                  j                  d      rJ |j                  j                  d      rJ t        j                  ||       y y )Nr	   r
   r   Tr   )
r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   s        r   !test_clip_inplace_reference_no_opr"   !   s    	C%	&BggiGb#Ea5DGG!TG"Ib#.66677,,Q///99..q111
gt,     c                     t        dg di      }t        |d      }|j                  dd       t        j                  t        |d      |      sJ | r|j
                  j                  d      sJ y y r   )r   r   r   r   r   r   r   )r   r   r   s      r   test_clip_inplacer%   0   sj    	C%	&Bb#EGG!TG"Ib#.666ww((+++ r#   c                 (   t        dg di      }|j                         }|j                  d      }t        j                  t        |d      t        |d            rJ | r|j                  j                  d      sJ t        j                  ||       y )Nr	   r
   r   r   r   )
r   r   r   r   r   r   r   r   r   r   )r   r   df_origdf2s       r   	test_clipr*   ;   s{    	C%	&BggiG
'''
C	#s 3Yr35GHHHww((+++'2&r#   c                 6   t        dg di      }|j                  d      }| rJ|j                  j                  d      rJ t	        j
                  t        |d      t        |d            sJ y t	        j
                  t        |d      t        |d            rJ y )Nr	   r
   r   r'   )r   r   r   r   r   r   r   )r   r   r)   s      r   test_clip_no_opr,   G   s    	C%	&B
'''
C77,,Q///	#s 3Yr35GHHH##Ic3$72s9KLLLLr#   c                    t        g ddd      }|j                         }| rt        j                         5  |d   j	                  ddd       d d d        t        j
                  ||       t        j                         5  |dg   j	                  ddd       d d d        t        j
                  ||       y t        j                  t        st        nd d	      5  |d   j	                  ddd       d d d        t        j                  d       5  t        d
d       5  |dg   j	                  ddd       d d d        d d d        t        j                  d       5  t        d
d       5  ||d   dkD     j	                  ddd       d d d        d d d        y # 1 sw Y   KxY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   PxY w# 1 sw Y   y xY w)N)      r   r.   )r	   br	   r   T)r   zinplace method)matchzmode.chained_assignment)
r   r   r   raises_chained_assignment_errorr   r   assert_produces_warningr   FutureWarningr   )r   r   r(   s      r   test_clip_chained_inplacer5   R   s   	+	,BggiG//1 	-sGLLAtL,	-
b'*//1 	/uINN1aN.	/
b'*''!7MT"
 	- sGLLAtL,		- ''- 	3 94@ 3C5	q!T23	3 ''- 	9 94@ 92c7Q;$$Q4$89	9 	9%	- 	-	/ 	/	- 	-3 3	3 	3
9 9	9 	9sk   FF%F2G
F>7G
G")GG"F"%F/2F;>G	G

GG	G""G+)numpyr   pandas.compatr   pandasr   r   pandas._testing_testingr   pandas.tests.copy_view.utilr   r    r"   r%   r*   r,   r5    r#   r   <module>r=      s7     0  1;(-,	'M9r#   