a
    Gb	                     @   s@   d dl Zd dlZd dlZd dlmZ dd Zdd Z	dd Z
dS )    Nc                 C   sd   g d}|  |}| | }||s(J d}tjt|d | j W d    n1 sV0    Y  d S )N)      r      z+'MultiIndex' object has no attribute 'freq'match)takeZequalspytestraisesAttributeErrorZfreq)idxZindexerresultexpectedmsg r   Clib/python3.9/site-packages/pandas/tests/indexes/multi/test_take.py	test_take   s    
r   c                 C   s   | } ddg}d}t jt|d | j|dd W d    n1 sB0    Y  d}t jt|d | j||d W d    n1 s0    Y  d}t jt|d | j|d	d
 W d    n1 s0    Y  d S )N   r   z1take\(\) got an unexpected keyword argument 'foo'r   )Zfooz$the 'out' parameter is not supported)outz%the 'mode' parameter is not supportedZclip)mode)r   r	   	TypeErrorr   
ValueError)r   indicesr   r   r   r   test_take_invalid_kwargs   s    ,,r   c                  C   s,  ddgt dt dgg} t jj| ddgd}|tg d}dt dfdt dfdt dfg}t jj|ddgd}t	|| |jtg dd	d
}dt dfdt dftj
t jfg}t jj|ddgd}t	|| |jtg ddd	d}dt dfdt dfdt dfg}t jj|ddgd}t	|| d}tjt|d( |jtg dd	d
 W d    n1 s0    Y  tjt|d( |jtg dd	d
 W d    n1 s0    Y  d}tjt|d$ |tddg W d    n1 s0    Y  d S )NABz
2011-01-01z
2011-01-02strZdt)names)r   r   T)
fill_valueF)Z
allow_fillr   zJWhen allow_fill=True and fill_value is not None, all indices must be >= -1r   )r   r   )r   r   z3index -5 is out of bounds for( axis 0 with)? size 4r   r    )pdZ	TimestampZ
MultiIndexZfrom_productr   npZarrayZfrom_tuplestmZassert_index_equalnanZNaTr   r	   r   
IndexError)Zvalsr   r   Zexp_valsr   r   r   r   r   test_take_fill_value%   s>    
88r&   )Znumpyr"   r   Zpandasr!   Zpandas._testingZ_testingr#   r   r   r&   r   r   r   r   <module>   s   