
    Pi	                     X    d dl Zd dlZd dlmZmZ d dlmZ d dl	m
Z
  G d d          ZdS )    N)Index
date_rangecartesian_productc                       e Zd Zd Zd Zej                            dg g gddgg gg g dgg          d             Zd Z	ej                            d	ddgdd
gdgd
gddgddgdgdgg          d             Z
d ZdS )TestCartesianProductc                     t          d          ddg}}t          ||g          \  }}t          j        g d          }t          j        g d          }t	          j        ||           t	          j        ||           d S )NABC      )Ar   Br   Cr   )r   r   r   r   r   r   )listr   nparraytmassert_numpy_array_equal)selfxyresult1result2	expected1	expected2s          x/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/pandas/tests/indexes/multi/test_util.pytest_simplez TestCartesianProduct.test_simple   s    E{{QG1,aV44H;;;<<	H22233	
#GY777
#GY77777    c                 ,   t          dd          }d t          ||g          D             \  }}t          g dt          j                  }t          g dt          j                  }t          j        ||           t          j        ||           d S )Nz
2000-01-01   )periodsc              3   >   K   | ]}t          |          j        V  d S N)r   day).0r   s     r   	<genexpr>z:TestCartesianProduct.test_datetimeindex.<locals>.<genexpr>   s*      LLQE!HHLLLLLLLr   )r   r   r    r    dtype)r   r    r   r    )r   r   r   r   int32r   assert_index_equal)r   r   r   r   r   r   s         r   test_datetimeindexz'TestCartesianProduct.test_datetimeindex   s     |Q///LL2CQF2K2KLLL,,,bh777	,,,bh777	
gy111
gy11111r   zx, yr   r   )abcc                 6   t          j        g t          j        |          j                  }t          j        g t          j        |          j                  }t	          ||g          \  }}t          j        ||           t          j        ||           d S )Nr'   )r   r   asarrayr(   r   r   r   )r   r   r   r   r   r   r   s          r   
test_emptyzTestCartesianProduct.test_empty   s     HRrz!}}':;;;	HRrz!}}':;;;	,aV44
#GY777
#GY77777r   c                 8    t          g           }g }||k    sJ d S r#   r   )r   resultexpecteds      r   test_empty_inputz%TestCartesianProduct.test_empty_input(   s+    "2&&!!!!!!r   Xr    r,   r-   c                     d}t          j        t          |          5  t          |           d d d            d S # 1 swxY w Y   d S )Nz'Input must be a list-like of list-likesmatchr6   )pytestraises	TypeErrorr   )r   r6   msgs      r   test_invalid_inputz'TestCartesianProduct.test_invalid_input.   s     8]9C000 	# 	#""""	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	#s   <A A c                    d}d t          d          D             t          j        dt          j                  gz   }t	          j        t          |          5  t          |           d d d            d S # 1 swxY w Y   d S )Nz+Product space too large to allocate arrays!c                 P    g | ]#}t          j        d dt           j                  $S )r   r   r'   )r   arangeint16)r%   is     r   
<listcomp>zBTestCartesianProduct.test_exceed_product_space.<locals>.<listcomp>;   s+    DDDQ	!Rrx000DDDr      i;  r'   r8   r:   )ranger   rB   rC   r;   r<   
ValueErrorr   )r   r>   dimss      r   test_exceed_product_spacez.TestCartesianProduct.test_exceed_product_space7   s    ;DD%))DDDYuBH---H
 
 ]:S111 	& 	&%%%%	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	&s   A77A;>A;N)__name__
__module____qualname__r   r+   r;   markparametrizer1   r5   r?   rJ    r   r   r   r      s        8 8 82 2 2 [Vr2h!Qr???>S%TUU8 8 VU8" " " [a!q!fsAhcUS#J#M # # #& & & & &r   r   )numpyr   r;   pandasr   r   pandas._testing_testingr   pandas.core.indexes.multir   r   rP   r   r   <module>rV      s                      7 7 7 7 7 73& 3& 3& 3& 3& 3& 3& 3& 3& 3&r   