
    EgB%                         d dl Zd dlZd dlZd dlmZmZ d dlmZ	 d Z
d Zd Zd Zd Zd Zd	 Zd
 Z G d d          ZdS )    N)Index
MultiIndexc                     d}t          j        t          |          5  |                                  | d d                                          d d d            d S # 1 swxY w Y   d S )NMultiIndex.format is deprecatedmatchr   )tmassert_produces_warningFutureWarningformat)idxmsgs     \/var/www/sysmax/venv/lib/python3.11/site-packages/pandas/tests/indexes/multi/test_formats.pytest_formatr      s    
+C		#M	=	=	=  

BQB                 s   1AA #A c                      t          ddgddggg dg dgddg          } d}t          j        t          |          5  |                     d	           d d d            d S # 1 swxY w Y   d S )
Nr      )r   r   r   r   )r   r   r   r   )levelscodesnamesr   r   Tr   r   r	   r
   r   r   )indexr   s     r   test_format_integer_namesr      s    AAlll'CAq6  E ,C		#M	=	=	= ! !4   ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !s   A""A&)A&c                    d}t          j        dd          5  t          j        t          |          5  |                                 }d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   |d         dk    sJ d S )Nr   zdisplay.multi_sparseFr   r   zfoo  two)pdoption_contextr	   r
   r   r   )r   r   results      r   test_format_sparse_configr      s   
+C		15	9	9 " "'SAAA 	" 	"ZZ\\F	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	"" " " " " " " " " " " " " " " !9
""""""s4   A,A	A,A	A,A	A,,A03A0c                     t          ddgddgddgdggg dg dg dg dg          } d}t          j        t          |	          5  |                                 }d d d            n# 1 swxY w Y   |d
         dk    sJ d S )Nr   r   )r   r   r   r   r   r   )r   r   r   r   r   r   )r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r      z
1  0  0  0r   )r   r   r   s      r   test_format_sparse_displayr"   %   s    AAA,	
  E ,C		#M	=	=	=                                 !9$$$$$$s   A''A+.A+c                      t          j        dd          5  g dg dg dd} t          j        |                               ddg          j        }d	t          |          vsJ 	 d d d            d S # 1 swxY w Y   d S )
Nzdisplay.encodingzUTF-8u   א   r!                  	   abcr/   r0   \)r   r   	DataFrame	set_indexr   repr)dr   s     r   test_repr_with_unicode_datar7   5   s    		-w	7	7 ' '"""CCQ))3*55;4;;&&&&&' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 's   AA22A69A6c                     t          j        t          d          t          d          gddg          } d}t	          j        t          |          5  t          t          |                      d d d            d S # 1 swxY w Y   d S )Nabr!   firstsecondr   zMust pass both levels and codesr   )	r   from_productlistrangepytestraises	TypeErrorevalr5   )mir   s     r   test_repr_roundtrip_raisesrD   <   s    		 $t**eAhh!7?R	S	S	SB
+C	y	,	,	,  T"XX                 s   A<<B B c                      g dg dg dd} t          j        |                               ddg          j        }t	          |           d S )Nr$   r&   r*   r.   r/   r0   )r   r3   r4   r   str)r6   r   s     r    test_unicode_string_with_unicoderG   C   sP    YYYYYY??A
,q//
#
#S#J
/
/
5CHHHHH    c                     |                      d          } t          j        dd           5  t          |            dt	          |           vsJ 	 d d d            d S # 1 swxY w Y   d S )N2   display.max_seq_itemsz...)repeatr   r   r5   rF   )r   s    r   test_repr_max_seq_item_settingrM   I   s    
**R..C		2D	9	9 % %S			CHH$$$$$% % % % % % % % % % % % % % % % % %s   #AA #A c                   2    e Zd Zd Zd Zd Zd Zd Zd ZdS )TestReprc                 t   t          g d          t          ddg          g}t          j        d                              d          t          j        t          j        d          d          g}t          ||          }t          |j                   t          |                    d                     d S )N)u   a/σu   b/σu   c/σr   r   r!   r%   r    )	r   nparangerL   tiler   r5   r   get_level_values)selfr   r   r   s       r   test_unicode_repr_issuesz!TestRepr.test_unicode_repr_issuesR   s    <<<==uaV}}M1$$Q''1q)A)AB&666U\U##A&&'''''rH   c                     t          j        dd          5  |                                }d}||k    sJ 	 d d d            d S # 1 swxY w Y   d S )NrK   r)   MultiIndex([('foo', 'one'),
            ('foo', 'two'),
            ('bar', 'one'),
            ('baz', 'two'),
            ('qux', 'one'),
            ('qux', 'two')],
           names=['first', 'second']))r   r   __repr__rU   r   r   expecteds       r   "test_repr_max_seq_items_equal_to_nz+TestRepr.test_repr_max_seq_items_equal_to_nZ   s    6:: 
	& 
	&\\^^F)H X%%%%%
	& 
	& 
	& 
	& 
	& 
	& 
	& 
	& 
	& 
	& 
	& 
	& 
	& 
	& 
	& 
	& 
	& 
	&s   AA
Ac                    |d d                                          }d}||k    sJ |                                 }d}||k    sJ t          j        dd          5  |                                 }d}||k    sJ 	 d d d            n# 1 swxY w Y   t          j        dd          5  |                                 }d}||k    sJ 	 d d d            d S # 1 swxY w Y   d S )Nr   zBMultiIndex([('foo', 'one')],
           names=['first', 'second'])rX   rK   r(   zMultiIndex([('foo', 'one'),
            ('foo', 'two'),
            ...
            ('qux', 'one'),
            ('qux', 'two')],
           names=['first', 'second'], length=6)zWMultiIndex([...
            ('qux', 'two')],
           names=['first', ...], length=6))rY   r   r   rZ   s       r   	test_reprzTestRepr.test_reprh   s   RaR!!##) !!!!) !!!!6:: 		& 		&\\^^F3H X%%%%%		& 		& 		& 		& 		& 		& 		& 		& 		& 		& 		& 		& 		& 		& 		& 6:: 	& 	&\\^^F.H X%%%%%	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	&s$   BB
B
&CCCc                    d}t          j        t          d|z            dg|z  z             }t          j        dd|dz            }t	          j        ||j        dz   |gg d	
          }|d d                                         }d}||k    sJ |d d d                                         }d}||k    sJ |                                }d}||k    sJ d S )N  r/   abc
2000-01-01sr%   freqperiodsr-   )r/   r0   dtir   r   zQMultiIndex([('a', 9, '2000-01-01 00:00:00')],
           names=['a', 'b', 'dti'])i  zMultiIndex([(  'a',  9, '2000-01-01 00:00:00'),
            (  'a',  9, '2000-01-01 00:08:20'),
            ('abc', 10, '2000-01-01 00:16:40'),
            ('abc', 10, '2000-01-01 00:25:00')],
           names=['a', 'b', 'dti'])a  MultiIndex([(  'a',  9, '2000-01-01 00:00:00'),
            (  'a',  9, '2000-01-01 00:00:01'),
            (  'a',  9, '2000-01-01 00:00:02'),
            (  'a',  9, '2000-01-01 00:00:03'),
            (  'a',  9, '2000-01-01 00:00:04'),
            (  'a',  9, '2000-01-01 00:00:05'),
            (  'a',  9, '2000-01-01 00:00:06'),
            (  'a',  9, '2000-01-01 00:00:07'),
            (  'a',  9, '2000-01-01 00:00:08'),
            (  'a',  9, '2000-01-01 00:00:09'),
            ...
            ('abc', 10, '2000-01-01 00:33:10'),
            ('abc', 10, '2000-01-01 00:33:11'),
            ('abc', 10, '2000-01-01 00:33:12'),
            ('abc', 10, '2000-01-01 00:33:13'),
            ('abc', 10, '2000-01-01 00:33:14'),
            ('abc', 10, '2000-01-01 00:33:15'),
            ('abc', 10, '2000-01-01 00:33:16'),
            ('abc', 10, '2000-01-01 00:33:17'),
            ('abc', 10, '2000-01-01 00:33:18'),
            ('abc', 10, '2000-01-01 00:33:19')],
           names=['a', 'b', 'dti'], length=2000))r   CategoricalIndexr=   
date_ranger   from_arraysr   rY   )rU   ncirg   rC   r   r[   s          r   
test_rjustzTestRepr.test_rjust   s    cAg5'A+!>??mLsAEBBB#RAs$;CTCTCTUUUBQB""' !!!!EEcE##%%' !!!!4. !!!!!!rH   c                    d}t          j        t          d|z            dg|z  z             }t          j        dd|dz            }||j        dz   |||g}g d	}t          j        ||
          }|d d                                         }d}||k    sJ |d d                                         }d}||k    sJ |                                }d}||k    sJ d S )Nr`   r/   ra   rb   rc   r%   rd   r-   )r/   r0   dti_1dti_2dti_3r   r   zMultiIndex([('a', 9, '2000-01-01 00:00:00', '2000-01-01 00:00:00', ...)],
           names=['a', 'b', 'dti_1', 'dti_2', 'dti_3'])
   a  MultiIndex([('a', 9, '2000-01-01 00:00:00', '2000-01-01 00:00:00', ...),
            ('a', 9, '2000-01-01 00:00:01', '2000-01-01 00:00:01', ...),
            ('a', 9, '2000-01-01 00:00:02', '2000-01-01 00:00:02', ...),
            ('a', 9, '2000-01-01 00:00:03', '2000-01-01 00:00:03', ...),
            ('a', 9, '2000-01-01 00:00:04', '2000-01-01 00:00:04', ...),
            ('a', 9, '2000-01-01 00:00:05', '2000-01-01 00:00:05', ...),
            ('a', 9, '2000-01-01 00:00:06', '2000-01-01 00:00:06', ...),
            ('a', 9, '2000-01-01 00:00:07', '2000-01-01 00:00:07', ...),
            ('a', 9, '2000-01-01 00:00:08', '2000-01-01 00:00:08', ...),
            ('a', 9, '2000-01-01 00:00:09', '2000-01-01 00:00:09', ...)],
           names=['a', 'b', 'dti_1', 'dti_2', 'dti_3'])aE  MultiIndex([(  'a',  9, '2000-01-01 00:00:00', '2000-01-01 00:00:00', ...),
            (  'a',  9, '2000-01-01 00:00:01', '2000-01-01 00:00:01', ...),
            (  'a',  9, '2000-01-01 00:00:02', '2000-01-01 00:00:02', ...),
            (  'a',  9, '2000-01-01 00:00:03', '2000-01-01 00:00:03', ...),
            (  'a',  9, '2000-01-01 00:00:04', '2000-01-01 00:00:04', ...),
            (  'a',  9, '2000-01-01 00:00:05', '2000-01-01 00:00:05', ...),
            (  'a',  9, '2000-01-01 00:00:06', '2000-01-01 00:00:06', ...),
            (  'a',  9, '2000-01-01 00:00:07', '2000-01-01 00:00:07', ...),
            (  'a',  9, '2000-01-01 00:00:08', '2000-01-01 00:00:08', ...),
            (  'a',  9, '2000-01-01 00:00:09', '2000-01-01 00:00:09', ...),
            ...
            ('abc', 10, '2000-01-01 00:33:10', '2000-01-01 00:33:10', ...),
            ('abc', 10, '2000-01-01 00:33:11', '2000-01-01 00:33:11', ...),
            ('abc', 10, '2000-01-01 00:33:12', '2000-01-01 00:33:12', ...),
            ('abc', 10, '2000-01-01 00:33:13', '2000-01-01 00:33:13', ...),
            ('abc', 10, '2000-01-01 00:33:14', '2000-01-01 00:33:14', ...),
            ('abc', 10, '2000-01-01 00:33:15', '2000-01-01 00:33:15', ...),
            ('abc', 10, '2000-01-01 00:33:16', '2000-01-01 00:33:16', ...),
            ('abc', 10, '2000-01-01 00:33:17', '2000-01-01 00:33:17', ...),
            ('abc', 10, '2000-01-01 00:33:18', '2000-01-01 00:33:18', ...),
            ('abc', 10, '2000-01-01 00:33:19', '2000-01-01 00:33:19', ...)],
           names=['a', 'b', 'dti_1', 'dti_2', 'dti_3'], length=2000))r   rh   r=   ri   r   r   rj   rY   )	rU   rk   rl   rg   r   r   rC   r   r[   s	            r   test_tuple_widthzTestRepr.test_tuple_width   s    cAg5'A+!>??mLsAEBBBbhlCc2555#F%888BQB"";!!!!CRC!!##; !!!!H. !!!!!!rH   c                 ^    t          j        dg          }d}t          |          |k    sJ d S )N)>ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccz^MultiIndex([('cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',)],
           ))r   from_tuplesrF   )rU   datar[   s      r   test_multiindex_long_elementz%TestRepr.test_multiindex_long_element   s=    %{m448 	 4yyH$$$$$$rH   N)	__name__
__module____qualname__rV   r\   r^   rm   rs   rx    rH   r   rO   rO   Q   sq        ( ( (& & &$& $& $&L," ," ,"\3" 3" 3"j% % % % %rH   rO   )numpyrQ   r?   pandasr   r   r   pandas._testing_testingr	   r   r   r   r"   r7   rD   rG   rM   rO   r|   rH   r   <module>r      s                          ! ! !# # #% % % ' ' '    % % %h% h% h% h% h% h% h% h% h% h%rH   