3
pdqz                 @   s
  d Z ddlmZ ddlmZmZmZmZ ddlm	Z	 ddl
Z
ddlZddlmZmZ ddlZddlmZ ddlZddlZddlmZmZ ddljjZddlZdd	lmZ ddlj Z!dd
l"m#Z# ddl$m%Z%m&Z& dd Z'dd Z(dd Z)ej*j+ddej,j-fd ej*j.d xFdj/ D ]:Z0e1ej2j3e0Z4ej5e4ej6e4ej7d-dej8 d qW xRdj/ D ]FZ0e1ej2j3e0Z4ej5e4ej6e4ej7d.dej8 ej7dddd q\W xRdj/ D ]FZ0e1ej2j3e0Z4ej5e4ej6e4ej7d/dej8 ej7dddd  qW ej9d!d"d#d$ Z:ej9d!d"d%d& Z;ej9ddd'd(gd)d* d+d,d- Z<e<Z=ej9dd'gd.d* d+d/d0 Z>ej9d!d1dgd2d3d4 Z?ej9d!d1dgd2d5d6 Z@ej9d7d8d1gd2d9d: ZAej9d;d<d=d>gd2d?d@ ZBej9d;d<d=d>gd2dAdB ZCej9ddCdDdEdFgd2dGdH ZDej9dCdDdEdFgd2dIdJ ZEej9d!d1gd2dKdL ZFej9dMdNd;d<gd2dOdP ZGej9dQdRgd2dSdT ZHej9dejIejJeKdUejLgeMd+dVdW ZNeNZOej9dejIejJgd2dXdY ZPePZQej9ej%ejRgd'dZgd+d[d\ ZSeSZTej9d]d^ ZUej9d_d` ZVej9dadb ZWdcdd ZXdedf ZYe!jZdge!j[dge!j\dge!j\dgdhdie!j]dge!j^dge!j_dge!j`dge!jadge!jbdge!jcdje!jddge!jedge%g e&jfegdkdldmgddndogeY eX e%dddddndngdpZhej9ehji d2dqd' ZjejZkej9drds Zlej9dtdu Zmej9dvdw Znej9dxdy Zodzd{ Zpd|d} ehjq D Zrej9d~d Zsejtejuejvejwejxejyejzej{gZ|dd} e|D Z}ej9e}ji d2dd Z~ehere}Zej9eji d2dd Zej9dd Zej9dd Zej9dd Zej9dd ZddddddddddddddgZej9ed2dd Zej9e
je#je
je#je
je#je
je#je
je#je
je#je
je#jgd2dd Zddddddddddg
Zej9ed2dd ZddgZej9ed2dd Zee Zej9ed2dd Zej9ddddddgd2dd Zej9ddddgd2dd Zej9ddddddgd2dd Zej9ddĄ Zej9ddƄ Zej9ddȄ Zdddddde e ed΃eded0ejeeddύeed1dύdkdЍgZdd҄ eD ZejeMeej9eed+ddԄ ZejeMedd ej9edd edd d+ddք ZeZej9dd؍ddڄ Zej9ddee ejgd2ddބ Zej9e!jd2dd Zej9e!jd2dd Zej9e!jd2dd Zej9e!jd2dd Zej9e!jd2dd Zej9e!jd2dd Zej9e!jd2dd Zej9e!jd2dd Zej9e!jd2dd Zej9e!jd2dd Zej9e!jd2dd Zej9e!jd2dd Zej9e!jd2dd Zej9e!jd2dd ZddejIdgfddejLdgfddejId gfdejIejIejIgfdg fddejIdngfddejIdgfddejIdgfddejIdngfddejIdgfd	e	dejIe	dngfd
d!ejId1gfd
d!ejLd1gfdejƐdejIejƐdgfdejǐdejIejǐdgfdedddejIedddgfdedejIedngfdedejIedngfdejȐdejJejȐdgfdejddejIejddngfgZegeʎ \ZZej9eed+dd Zej9dd Zej9ddddd d!d"gd2d#d$ Zej9ee!jуd2d%d& Zej9d'd҄ ej3jD d2d(d) Zej9dd*d* gd2d+d, ZdS (2  a  
This file is very long and growing, but it was decided to not split it yet, as
it's still manageable (2020-03-17, ~1.1k LoC). See gh-31989

Instead of splitting it was decided to define sections here:
- Configuration / Settings
- Autouse fixtures
- Common arguments
- Missing values & co.
- Classes
- Indices
- Series'
- DataFrames
- Operators & Operations
- Data sets/files
- Time zones
- Dtypes
- Misc
    )abc)datetime	timedeltatimezone)DecimalN)tzlocaltzutc)
strategies)FixedOffsetutc)	DataFrame)ops)Index
MultiIndexc             C   sL   | j dd | j dd | j dd | j dd | j dd | j dd d S )Nmarkersz&single: mark a test as single cpu onlyzslow: mark a test as slowznetwork: mark a test as networkz2db: tests requiring a database (mysql or postgres)z.high_memory: mark a test as a high-memory onlyz(clipboard: mark a pd.read_clipboard test)Zaddinivalue_line)config r   1/tmp/pip-build-7vycvbft/pandas/pandas/conftest.pypytest_configure/   s    r   c             C   sd   | j dddd | j dddd | j dddd | j d	dd
d | j dddd | j dddd d S )Nz--skip-slow
store_truezskip slow tests)actionhelpz--skip-networkzskip network testsz	--skip-dbzskip db testsz--run-high-memoryzrun high memory testsz--only-slowzrun only slow testsz--strict-data-filesz0Fail if a test is skipped for missing data file.)Z	addoption)parserr   r   r   pytest_addoption<   s    r   c             C   s   d| j kr | jjdr tjd d| j kr@| jjdr@tjd d| j kr`| jjdr`tjd d	| j kr| jjd
rtjd d| j kr| jjd rtjd d S )NZslowz--skip-slowzskipping due to --skip-slowz--only-slowzskipping due to --only-slownetworkz--skip-networkzskipping due to --skip-networkdbz	--skip-dbzskipping due to --skip-dbZhigh_memoryz--run-high-memoryz=skipping high memory test since --run-high-memory was not set)keywordsr   	getoptionpytestskip)itemr   r   r   pytest_runtest_setupK   s    



r"   Zcii  )deadlineZsuppress_health_checkz)MonthBegin MonthEnd BMonthBegin BMonthEndc   )n	normalizez%YearBegin YearEnd BYearBegin BYearEnd         )Z	min_valueZ	max_value)r%   r&   monthz1QuarterBegin QuarterEnd BQuarterBegin BQuarterEnd   )r%   r&   ZstartingMonthT)Zautousec               C   s   t jdd dS )z<
    Configure settings for all tests and test modules.
    Zchained_assignmentraiseN)pdZ
set_optionr   r   r   r   configure_tests   s    r.   c             C   s   t | d< t| d< dS )z:
    Make `np` and `pd` names available for doctests.
    npr-   N)r/   r-   )Zdoctest_namespacer   r   r   add_imports   s    r0   indexcolumnsc             C   s   dt |  S )Nzaxis )repr)xr   r   r   <lambda>   s    r5   )paramsidsc             C   s   | j S )z@
    Fixture for returning the axis numbers of a DataFrame.
    )param)requestr   r   r   axis   s    r:   c             C   s   dt |  S )Nzaxis )r3   )r4   r   r   r   r5      s    c             C   s   | j S )z=
    Fixture for returning the axis numbers of a Series.
    )r8   )r9   r   r   r   axis_series   s    r;   F)r6   c             C   s   | j S )a  
    Pass in the observed keyword to groupby for [True, False]
    This indicates whether categoricals should return values for
    values which are not in the grouper [False / None], or only values which
    appear in the grouper [True]. [None] is supported for future compatibility
    if we decide to change the default (and would need to warn if this
    parameter is not passed).
    )r8   )r9   r   r   r   observed   s    
r<   c             C   s   | j S )z6
    Boolean 'ordered' parameter for Categorical.
    )r8   )r9   r   r   r   ordered   s    r=   firstlastc             C   s   | j S )z[
    Valid values for the 'keep' parameter used in
    .duplicated or .drop_duplicates
    )r8   )r9   r   r   r   keep   s    r@   leftrightZbothZneitherc             C   s   | j S )z<
    Fixture for trying all interval closed parameters.
    )r8   )r9   r   r   r   closed   s    rC   c             C   s   | j S )zS
    Secondary closed fixture to allow parametrizing over all pairs of closed.
    )r8   )r9   r   r   r   other_closed   s    rD   gzipbz2zipxzc             C   s   | j S )zK
    Fixture for trying common compression types in compression tests.
    )r8   )r9   r   r   r   compression   s    rI   c             C   s   | j S )zk
    Fixture for trying common compression types in compression tests excluding
    uncompressed case.
    )r8   )r9   r   r   r   compression_only   s    rJ   c             C   s   | j S )z,
    Fixture that an array is writable.
    )r8   )r9   r   r   r   writable   s    rK   innerouterc             C   s   | j S )z:
    Fixture for trying all types of join operations.
    )r8   )r9   r   r   r   	join_type   s    rN   nlargest	nsmallestc             C   s   | j S )z1
    Fixture for trying all nselect methods.
    )r8   )r9   r   r   r   nselect_method  s    rQ   nanc             C   s   | j S )z/
    Fixture for each null type in pandas.
    )r8   )r9   r   r   r   nulls_fixture  s    rS   c             C   s   | j S )zL
    Fixture for each null type in pandas, each null type exactly once.
    )r8   )r9   r   r   r   unique_nulls_fixture  s    rT   seriesc             C   s   | j S )z
    Fixture to parametrize over Index and Series, made necessary by a mypy
    bug, giving an error:

    List item 0 has incompatible type "Type[Series]"; expected "Type[PandasObject]"

    See GH#29725
    )r8   )r9   r   r   r   index_or_series*  s    
rV   c              C   s   G dd dt } | S )z,
    Fixture for a dictionary subclass.
    c               @   s   e Zd Zdd ZdS )z"dict_subclass.<locals>.TestSubDictc             _   s   t j| f|| d S )N)dict__init__)selfargskwargsr   r   r   rX   B  s    z+dict_subclass.<locals>.TestSubDict.__init__N)__name__
__module____qualname__rX   r   r   r   r   TestSubDictA  s   r_   )rW   )r_   r   r   r   dict_subclass;  s    r`   c              C   s   G dd dt j} | S )z8
    Fixture for a non-mapping dictionary subclass.
    c               @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
z5non_dict_mapping_subclass.<locals>.TestNonDictMappingc             S   s
   || _ d S )N)_data)rY   Zunderlying_dictr   r   r   rX   O  s    z>non_dict_mapping_subclass.<locals>.TestNonDictMapping.__init__c             S   s   | j j|S )N)ra   __getitem__)rY   keyr   r   r   rb   R  s    zAnon_dict_mapping_subclass.<locals>.TestNonDictMapping.__getitem__c             S   s
   | j j S )N)ra   __iter__)rY   r   r   r   rd   U  s    z>non_dict_mapping_subclass.<locals>.TestNonDictMapping.__iter__c             S   s
   | j j S )N)ra   __len__)rY   r   r   r   re   X  s    z=non_dict_mapping_subclass.<locals>.TestNonDictMapping.__len__N)r\   r]   r^   rX   rb   rd   re   r   r   r   r   TestNonDictMappingN  s   rf   )r   Mapping)rf   r   r   r   non_dict_mapping_subclassH  s    rh   c              C   sb   t jd} | jdd dd dd gj }|jjdd |jjD dd	 |jjd
ddgdd	 |S )z
    DataFrame with 3 level MultiIndex (year, month, day) covering
    first 100 business days from 2000-01-01 with random data
    d   c             S   s   | j S )N)year)r4   r   r   r   r5   h  s    zAmultiindex_year_month_day_dataframe_random_data.<locals>.<lambda>c             S   s   | j S )N)r*   )r4   r   r   r   r5   h  s    c             S   s   | j S )N)day)r4   r   r   r   r5   h  s    c             S   s   g | ]}|j d qS )i8)astype).0Zlevr   r   r   
<listcomp>j  s    zCmultiindex_year_month_day_dataframe_random_data.<locals>.<listcomp>T)Zinplacerj   r*   rk   )tmZmakeTimeDataFramegroupbysumr1   Z
set_levelslevelsZ	set_names)ZtdfZymdr   r   r   /multiindex_year_month_day_dataframe_random_dataa  s
    
 rt   c              C   sl   t ddddg} t ddg}tjdddd	d
d
g}tjddddddg}ddg}t| |g||g|dd}|S )zJ
    MultiIndex used to test the general functionality of this object
    foobarbazZquxonetwor   r(         r>   secondF)rs   codesnamesZverify_integrity)r   r/   arrayr   )Z
major_axisZ
minor_axisZmajor_codesZminor_codesZindex_namesmir   r   r   _create_multiindexo  s    r   c               C   s.   t jddgddgtjddddgd	d
dgdS )zB
    MultiIndex with a level that is a tzaware DatetimeIndex.
    r(   rz   ab20130101r{   z
US/Eastern)Zperiodstzrx   ry   Zthree)r~   )r   Zfrom_productr-   Z
date_ranger   r   r   r   _create_mi_with_dt64tz_level  s    r   ri   z
US/Pacific)r   
   ru   rv   rw   rz   r{   )unicodestringdatetimezdatetime-tzperiodr   intZuintrangefloatboolZcategoricalintervalemptyZtupleszmi-with-dt64tz-levelZmultiZrepeatsc             C   s   t | j j S )z
    Fixture for many "simple" kinds of indices.

    These indices are unlikely to cover corner cases, e.g.
        - no names
        - no NaTs/NaNs
        - no values near implementation bounds
        - ...
    )indices_dictr8   copy)r9   r   r   r   r1     s    c               C   s   t jg g tjdS )N)r1   dtype)r-   Seriesr/   Zfloat64r   r   r   r   empty_series  s    r   c              C   s   t j } d| _| S )zC
    Fixture for Series of floats with Index of unique strings
    rU   )rp   ZmakeStringSeriesname)sr   r   r   string_series  s    r   c              C   s   t j } d| _| S )zI
    Fixture for Series of dtype object with Index of unique strings
    objects)rp   ZmakeObjectSeriesr   )r   r   r   r   object_series  s    r   c              C   s   t j } d| _| S )z9
    Fixture for Series of floats with DatetimeIndex
    ts)rp   ZmakeTimeSeriesr   )r   r   r   r   datetime_series  s    r   c             C   s$   t | }tjj|}tj|| ddS )z Helper for the _series dict r   )r1   r   )lenr/   randomZrandnr-   r   )r1   sizedatar   r   r   _create_series  s    r   c             C   s"   i | ]\}}t |d | dqS )zseries-with-z-index)r   )rn   Zindex_idr1   r   r   r   
<dictcomp>  s   r   c             C   s   t | S )zE
    Fixture for tests on series with changing types of indices.
    )r   )r1   r   r   r   series_with_simple_index  s    r   c             C   s(   i | ] }t jd dj||j dqS )r   )r   z-series)rp   ZmakeFloatSeriesrm   r\   )rn   r   r   r   r   r     s   c             C   s   t | j j S )z:
    Fixture for Series with low precision data types
    )_narrow_seriesr8   r   )r9   r   r   r   narrow_series  s    r   c             C   s   t | j jddS )z|
    Fixture for tests on indexes, series and series with a narrow dtype
    copy to avoid mutation, e.g. setting .name
    T)deep)_index_or_series_objsr8   r   )r9   r   r   r   index_or_series_obj  s    r   c               C   s   t  S )N)r   r   r   r   r   empty_frame  s    r   c               C   s   t tj jdS )a6  
    Fixture for DataFrame of ints with index of unique strings

    Columns are ['A', 'B', 'C', 'D']

                A  B  C  D
    vpBeWjM651  1  0  1  0
    5JyxmrP1En -1  0  0  0
    qEDaoD49U2 -1  1  0  0
    m66TkTfsFe  0  0  0  0
    EHPaNzEUFm -1  0 -1  0
    fpRJCevQhi  2  0  0  0
    OlQvnmfi3Q  0  0 -2  0
    ...        .. .. .. ..
    uB1FPlz4uP  0  0  0  1
    EcSe6yNzCU  0  0 -1  0
    L50VudaiI8 -1  1 -2  0
    y3bpw4nwIp  0 -1  0  0
    H0RdLLwrCT  1  1  0  0
    rY82K0vMwm  0  0  0  0
    1OPIUjnkjk  2  0  0  0

    [30 rows x 4 columns]
    Zint64)r   rp   getSeriesDatarm   r   r   r   r   	int_frame   s    r   c               C   s   t tj S )a  
    Fixture for DataFrame of floats with DatetimeIndex

    Columns are ['A', 'B', 'C', 'D']

                       A         B         C         D
    2000-01-03 -1.122153  0.468535  0.122226  1.693711
    2000-01-04  0.189378  0.486100  0.007864 -1.216052
    2000-01-05  0.041401 -0.835752 -0.035279 -0.414357
    2000-01-06  0.430050  0.894352  0.090719  0.036939
    2000-01-07 -0.620982 -0.668211 -0.706153  1.466335
    2000-01-10 -0.752633  0.328434 -0.815325  0.699674
    2000-01-11 -2.236969  0.615737 -0.829076 -1.196106
    ...              ...       ...       ...       ...
    2000-02-03  1.642618 -0.579288  0.046005  1.385249
    2000-02-04 -0.544873 -1.160962 -0.284071 -1.418351
    2000-02-07 -2.656149 -0.601387  1.410148  0.444150
    2000-02-08 -1.201881 -1.289040  0.772992 -1.445300
    2000-02-09  1.377373  0.398619  1.008453 -0.928207
    2000-02-10  0.473194 -0.636677  0.984058  0.511519
    2000-02-11 -0.965556  0.408313 -1.312844 -0.381948

    [30 rows x 4 columns]
    )r   rp   ZgetTimeSeriesDatar   r   r   r   datetime_frame=  s    r   c               C   s   t tj S )a  
    Fixture for DataFrame of floats with index of unique strings

    Columns are ['A', 'B', 'C', 'D'].

                       A         B         C         D
    P7GACiRnxd -0.465578 -0.361863  0.886172 -0.053465
    qZKh6afn8n -0.466693 -0.373773  0.266873  1.673901
    tkp0r6Qble  0.148691 -0.059051  0.174817  1.598433
    wP70WOCtv8  0.133045 -0.581994 -0.992240  0.261651
    M2AeYQMnCz -1.207959 -0.185775  0.588206  0.563938
    QEPzyGDYDo -0.381843 -0.758281  0.502575 -0.565053
    r78Jwns6dn -0.653707  0.883127  0.682199  0.206159
    ...              ...       ...       ...       ...
    IHEGx9NO0T -0.277360  0.113021 -1.018314  0.196316
    lPMj8K27FA -1.313667 -0.604776 -1.305618 -0.863999
    qa66YMWQa5  1.110525  0.475310 -0.747865  0.032121
    yOa0ATsmcE -0.431457  0.067094  0.096567 -0.264962
    65znX3uRNG  1.528446  0.160416 -0.109635 -0.032987
    eCOBvKqf3e  0.235281  1.622222  0.781255  0.392871
    xSucinXxuV -1.263557  0.252799 -0.552247  0.400426

    [30 rows x 4 columns]
    )r   rp   r   r   r   r   r   float_frameZ  s    r   __add____radd____sub____rsub____mul____rmul____floordiv____rfloordiv____truediv____rtruediv____pow____rpow____mod____rmod__c             C   s   | j S )zD
    Fixture for dunder names for common arithmetic operations.
    )r8   )r9   r   r   r   all_arithmetic_operators  s    r   c             C   s   | j S )z
    Fixture for operator and roperator arithmetic functions.

    Notes
    -----
    This includes divmod and rdivmod, whereas all_arithmetic_operators
    does not.
    )r8   )r9   r   r   r   all_arithmetic_functions  s    r   rr   maxminZmeanprodZstdvarZmedianZkurtZskewc             C   s   | j S )z.
    Fixture for numeric reduction names.
    )r8   )r9   r   r   r   all_numeric_reductions  s    r   allanyc             C   s   | j S )z.
    Fixture for boolean reduction names.
    )r8   )r9   r   r   r   all_boolean_reductions  s    r   c             C   s   | j S )z>
    Fixture for all (boolean + numeric) reduction names.
    )r8   )r9   r   r   r   all_reductions  s    r   __eq____ne____le____lt____ge____gt__c             C   s   | j S )zu
    Fixture for dunder names for common compare operations

    * >=
    * >
    * ==
    * !=
    * <
    * <=
    )r8   )r9   r   r   r   all_compare_operators  s    r   c             C   s   | j S )zm
    Fixture for dunder names for compare operations except == and !=

    * >=
    * >
    * <
    * <=
    )r8   )r9   r   r   r   compare_operators_no_eq_ne  s    
r   __and____rand____or____ror____xor____rxor__c             C   s   | j S )zY
    Fixture for dunder names for common logical operations

    * |
    * &
    * ^
    )r8   )r9   r   r   r   all_logical_operators  s    r   c             C   s
   | j dS )zO
    Returns the configuration for the test setting `--strict-data-files`.
    z--strict-data-files)r   )Zpytestconfigr   r   r   strict_data_files  s    r   c                s(   t jjt jjtd  fdd}|S )a=  
    Get the path to a data file.

    Parameters
    ----------
    path : str
        Path to the file, relative to ``pandas/tests/``

    Returns
    -------
    path including ``pandas/tests``.

    Raises
    ------
    ValueError
        If the path doesn't exist and the --strict-data-files option is set.
    testsc                 sJ   t jj f|  }t jj|sFr4td| dntjd| d |S )NzCould not find file z  and --strict-data-files is set.zCould not find .)ospathjoinexists
ValueErrorr   r    )rZ   r   )	BASE_PATHr   r   r   deco(  s    zdatapath.<locals>.deco)r   r   r   dirname__file__)r   r   r   )r   r   r   datapath  s    r   c             C   s   t j| ddddS )z*
    The iris dataset as a DataFrame.
    ior   csvziris.csv)r-   Zread_csv)r   r   r   r   iris6  s    r   UTCz
US/Easternz
Asia/Tokyozdateutil/US/Pacificzdateutil/Asia/Singaporei,  )hours)r   c             C   s   g | ]}t |qS r   )r3   )rn   ir   r   r   ro   Q  s    ro   c             C   s   | j S )zD
    Fixture for trying timezones including default (None): {0}
    )r8   )r9   r   r   r   tz_naive_fixtureT  s    r   c             C   s   | j S )z4
    Fixture for trying explicit timezones: {0}
    )r8   )r9   r   r   r   tz_aware_fixture]  s    r   module)Zscopec               C   s   t jS )zB
    Yields the UTC timezone object from the datetime module.
    )r   r   r   r   r   r   datetime_tz_utcj  s    r   r   zdateutil/UTCc             C   s   | j S )zQ
    Fixture to provide variants of UTC timezone strings and tzinfo objects.
    )r8   )r9   r   r   r   utc_fixturer  s    r   c             C   s   | j S )zR
    Parametrized fixture for string dtypes.

    * str
    * 'str'
    * 'U'
    )r8   )r9   r   r   r   string_dtype}  s    	r   c             C   s   | j S )zK
    Parametrized fixture for bytes dtypes.

    * bytes
    * 'bytes'
    )r8   )r9   r   r   r   bytes_dtype  s    r   c             C   s   | j S )zN
    Parametrized fixture for object dtypes.

    * object
    * 'object'
    )r8   )r9   r   r   r   object_dtype  s    r   c             C   s   | j S )z\
    Parametrized fixture for datetime64 dtypes.

    * 'datetime64[ns]'
    * 'M8[ns]'
    )r8   )r9   r   r   r   datetime64_dtype  s    r   c             C   s   | j S )z^
    Parametrized fixture for timedelta64 dtypes.

    * 'timedelta64[ns]'
    * 'm8[ns]'
    )r8   )r9   r   r   r   timedelta64_dtype  s    r   c             C   s   | j S )z^
    Parameterized fixture for float dtypes.

    * float
    * 'float32'
    * 'float64'
    )r8   )r9   r   r   r   float_dtype  s    	r   c             C   s   | j S )zg
    Parameterized fixture for complex dtypes.

    * complex
    * 'complex64'
    * 'complex128'
    )r8   )r9   r   r   r   complex_dtype  s    	r   c             C   s   | j S )z|
    Parameterized fixture for signed integer dtypes.

    * int
    * 'int8'
    * 'int16'
    * 'int32'
    * 'int64'
    )r8   )r9   r   r   r   
sint_dtype  s    r   c             C   s   | j S )zx
    Parameterized fixture for unsigned integer dtypes.

    * 'uint8'
    * 'uint16'
    * 'uint32'
    * 'uint64'
    )r8   )r9   r   r   r   
uint_dtype  s    
r   c             C   s   | j S )z
    Parameterized fixture for any integer dtype.

    * int
    * 'int8'
    * 'uint8'
    * 'int16'
    * 'uint16'
    * 'int32'
    * 'uint32'
    * 'int64'
    * 'uint64'
    )r8   )r9   r   r   r   any_int_dtype  s    r   c             C   s   | j S )z
    Parameterized fixture for any nullable integer dtype.

    * 'UInt8'
    * 'Int8'
    * 'UInt16'
    * 'Int16'
    * 'UInt32'
    * 'Int32'
    * 'UInt64'
    * 'Int64'
    )r8   )r9   r   r   r   any_nullable_int_dtype  s    r   c             C   s   | j S )z~
    Parameterized fixture for any signed nullable integer dtype.

    * 'Int8'
    * 'Int16'
    * 'Int32'
    * 'Int64'
    )r8   )r9   r   r   r   any_signed_nullable_int_dtype  s    
r   c             C   s   | j S )z
    Parameterized fixture for any (purely) real numeric dtype.

    * int
    * 'int8'
    * 'uint8'
    * 'int16'
    * 'uint16'
    * 'int32'
    * 'uint32'
    * 'int64'
    * 'uint64'
    * float
    * 'float32'
    * 'float64'
    )r8   )r9   r   r   r   any_real_dtype  s    r   c             C   s   | j S )a  
    Parameterized fixture for all numpy dtypes.

    * bool
    * 'bool'
    * int
    * 'int8'
    * 'uint8'
    * 'int16'
    * 'uint16'
    * 'int32'
    * 'uint32'
    * 'int64'
    * 'uint64'
    * float
    * 'float32'
    * 'float64'
    * complex
    * 'complex64'
    * 'complex128'
    * str
    * 'str'
    * 'U'
    * bytes
    * 'bytes'
    * 'datetime64[ns]'
    * 'M8[ns]'
    * 'timedelta64[ns]'
    * 'm8[ns]'
    * object
    * 'object'
    )r8   )r9   r   r   r   any_numpy_dtype-  s    "r   r   r   cbytes   a   cr   zmixed-integermixedg       @Zfloatingg      ?integerzmixed-integer-floatdecimalboolean
datetime64z
2013-01-01z
2018-01-01r   r   Z20180101r   i  i  r   r   r   r   c             C   s    | j \}}tj|td}||fS )a  
    Fixture for all inferred dtypes from _libs.lib.infer_dtype

    The covered (inferred) types are:
    * 'string'
    * 'empty'
    * 'bytes'
    * 'mixed'
    * 'mixed-integer'
    * 'mixed-integer-float'
    * 'floating'
    * 'integer'
    * 'decimal'
    * 'boolean'
    * 'datetime64'
    * 'datetime'
    * 'date'
    * 'timedelta'
    * 'time'
    * 'period'
    * 'interval'

    Returns
    -------
    inferred_dtype : str
        The string for the inferred dtype from _libs.lib.infer_dtype
    values : np.ndarray
        An array of object dtype that will be inferred to have
        `inferred_dtype`

    Examples
    --------
    >>> import pandas._libs.lib as lib
    >>>
    >>> def test_something(any_skipna_inferred_dtype):
    ...     inferred_dtype, values = any_skipna_inferred_dtype
    ...     # will pass
    ...     assert lib.infer_dtype(values, skipna=True) == inferred_dtype
    )r   )r8   r/   r   object)r9   Zinferred_dtypevaluesr   r   r   any_skipna_inferred_dtypep  s    )
r  c              C   s    t jddd ddlm}  |  S )zj
    Get an instance of IPython.InteractiveShell.

    Will raise a skip if IPython is not installed.
    ZIPythonz6.0.0)Z
minversionr   )InteractiveShell)r   ZimportorskipZIPython.core.interactiveshellr	  )r	  r   r   r   ip  s    r
  ZbsrZcooZcscZcsrZdiaZdokZlilc             C   s   ddl m} t|| jd S )z-
    Yields scipy sparse matrix classes.
    r   )sparseZ_matrix)Zscipyr  getattrr8   )r9   r  r   r   r   spmatrix  s    r  c             C   s   | j S )z
    Yields a tuple of a function and its corresponding name. Correspond to
    the list of aggregator "Cython functions" used on selected table items.
    )r8   )r9   r   r   r   cython_table_items  s    r  c             C   s.   g | ]&}t ttj|tjjrttj|qS r   )
issubclassr  r-   offsetsZTick)rn   or   r   r   ro     s   c             C   s   | j S )zN
    Fixture for Tick based datetime offsets available for a time series.
    )r8   )r9   r   r   r   tick_classes  s    r  c             C   s   | S )Nr   )r4   r   r   r   r5     s    c             C   s   | j S )zk
    Simple fixture for testing keys in sorting methods.
    Tests None (no key) and the identity key.
    )r8   )r9   r   r   r   sort_by_key  s    r  iii)__doc__collectionsr   r   r   r   r   r   r  r   operatorr   Zdateutil.tzr   r	   Z
hypothesisr
   stnumpyr/   r   Zpytzr   r   Zpandas.util._test_decoratorsutilZ_test_decoratorstdZpandasr-   r   Zpandas._testingZ_testingrp   Zpandas.corer   Zpandas.core.indexes.apir   r   r   r   r"   settingsZregister_profileZHealthCheckZtoo_slowZload_profilesplitr   r  Ztseriesr  clsZregister_type_strategyZbuildsZintegersZbooleansZfixturer.   r0   r:   Z
axis_framer;   r<   r=   r@   rC   rD   rI   rJ   rK   rN   rQ   rR   ZNaTr   ZNAstrrS   Znulls_fixture2rT   Zunique_nulls_fixture2r   rV   Zindex_or_series2r`   rh   rt   r   r   ZmakeUnicodeIndexZmakeStringIndexZmakeDateIndexZmakePeriodIndexZmakeTimedeltaIndexZmakeIntIndexZmakeUIntIndexZmakeRangeIndexZmakeFloatIndexZmakeBoolIndexZmakeCategoricalIndexZmakeIntervalIndexfrom_tuplesrG   r   keysr1   Zindex_fixture2r   r   r   r   r   itemsZ_seriesr   Zfloat16Zfloat32Zint8Zint16Zint32Zuint8Zuint16Zuint32Z_narrow_dtypesr   r   r   r   r   r   r   r   Z_all_arithmetic_operatorsr   addZraddsubZrsubmulZrmultruedivZrtruedivfloordivZ	rfloordivmodZrmodpowZrpowr   Z_all_numeric_reductionsr   Z_all_boolean_reductionsr   Z_all_reductionsr   r   r   r   r   r   r   Z	TIMEZONESZTIMEZONE_IDSZparametrize_fixture_docr   r   Ztz_aware_fixture2r   r   ZSTRING_DTYPESr   ZBYTES_DTYPESr   ZOBJECT_DTYPESr   ZDATETIME64_DTYPESr   ZTIMEDELTA64_DTYPESr   ZFLOAT_DTYPESr   ZCOMPLEX_DTYPESr   ZSIGNED_INT_DTYPESr   ZUNSIGNED_INT_DTYPESr   ZALL_INT_DTYPESr   ZALL_EA_INT_DTYPESr   ZSIGNED_EA_INT_DTYPESr   ZALL_REAL_DTYPESr   ZALL_NUMPY_DTYPESr   r  Z	TimestampZPeriodZIntervalZ_any_skipna_inferred_dtyper7   _r  r
  r  listZcython_tabler  __all__r  r  r   r   r   r   <module>   s  
("		*	"


		
! #(	"'  $ $34
	