fӼ8dZddlmZddlmZddlmZmZmZmZm Z ddl m Z ddl Z ddl Z ddlmZmZddlmZmZddlZdd lmZddlZddlZdd lmZmZdd lmZddlm cm!Z"dd l#m$Z$m%Z%ddl&Z'dd l&m(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3ddl4m5Z6ddl7m8Z8ddl9m:Z:m;Z;ddlm?Z?m@Z@ ddlAZB[BdZCddlEZE eEjdd7dZHd8dZId7dZJejjgZMe=eje=dk\r%eMjejjejjddeSeMejjddjD]eZVeWe'jjeVZZejeZejeZejddejgdjD]xZVeWe'jjeVZZejeZejeZejd d!ejejd"d#$%zd&jD]xZVeWe'jjeVZZejeZejeZejd'd(ejejd"d#$)zejd*d7d+Z`ejd*d7d,Zaejgd-d./d0ZbebZcejd"d1gd2/d3Zdejgd45d6Zeejgd45d7Zfejddg5d8Zgejgd95d:Zhejgd;5d<Ziejgd=5d>Zjejgd=5d?Zkejdd@dAdBdCdDejdEe"jdFGg5dHZnejd@dAdBdCdDejdEe"jdFGg5dIZoejddg5dJZpejgdK5dLZqejdMdNg5dOZreje6jdP/dQZtetZuejdeje'jg5dRZxexZyeje6jdS/dTZ{e{Z|eje)e.g5dUZ}eje:e.gdVdWg/dXZ~e~Zeje:e.e'jggdY/dZZeje:e.e)e'jgd[/d\ZeZejd9d]Zejd:d^Zejd_Zejd;d`Zej dd̄Zddddddddddeeedԫededիe j8e ed"֫e ed׬֫dج٫gZeE4eސjeEjdkeEjdgeDcgc] }e| c}Ze"jeeejee/dڄZe"jeed"dejed"ded"d/dۄZeZddeee j8gZeE!ejeEjdeje5dބZeZejgdߢ5dZeZeje6j5dZejdejde"jdGg5dZejdejde"jdGejde"jdGg5dZejdejde"jdGg5dZeZeje6j5dZeje6j5dZejddejde"jdGejde"jdGg5dZeje6j5dZeje6j5dZejd?dZeje6j5dZeje6j5dZeje6j5dZeje6j5dZeje6j5dZeje6j 5dZeje6j5dZ eje6j5dZ eje6j5dZ eje6je6jz5dZeje6je6jze6jze6j z5dZeje6j$5dZeje6j(5dZeje6j,5dZeje6j05dZeje6j45dZeje6j85dZdddejdgfddde'j<dgfdde'jdgfddejdgfdejejejgfdgfddejd gfddejd gfd d ejd gfd d"ejd gfdd"ejd gfde d"eje d gfddejdgfdde'j<dgfdej>dejej>dgfdge0deje0dgfdedd"d"ejedd"d"gfddejdgfdped"ejed gfded"ejed gfdme,de'je,dgfde*dd"eje*dd gfgZ ee \Z!Z"eje e!/dZ#ejdZ$ejgd5d Z%eje'jjLDcgc]K}e'eWe'j|e'jjPr|d!k7reWe'j|Mc}5d"Z)ejdd#g5d$Z*ejd%d&d'ejejejfeje'jdfeje'j<dfe'j<e'j<e'j<fg5d@d(Z+eje6jXe6jZe6j\g5d)Z/eje6jZe6j\g5d*Z0eje6jXe6j\g5d+Z1eje6jXe6jZg5d,Z2eje6jfe6jZg5d-Z4eje6jje6j\g5d.Z6ejdAd/Z7ejdAd0Z8ejdAd1Z9ejdAd2Z:d3d4gZ;eE#e;jeEjd3eje;5dBd5Z<ejd6Z=y#eD$rdZCYBwxYw#eEj$rdZEYCwxYwcc}wcc}wcc}wcc}}wcc}}wcc}}wcc}wcc}}wcc}wcc}wcc}w(Ca 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 ) annotations)abc)datedatetimetime timedeltatimezone)DecimalN) TYPE_CHECKINGCallable)tzlocaltzutc) strategies) FixedOffsetutc _get_option)DatetimeTZDtype IntervalDtype) CategoricalIndex DataFrameInterval IntervalIndexPeriod RangeIndexSeries Timedelta Timestamp date_range period_rangetimedelta_range)ops)Index MultiIndex)Version)HashableIteratorTFUTCc,|jdddy)N--no-strict-data-files store_falsez6Don't fail if a test is skipped for missing data file.)actionhelp) addoption)parsers X/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/pandas/conftest.pypytest_addoptionr1os   Ec|jj|r2|jtjj d|yy)aIgnore doctest warning. Parameters ---------- item : pytest.Item pytest test item. path : str Module path to Python object, e.g. "pandas.core.frame.DataFrame.append". A warning will be filtered when item.name ends with in given path. So it is sufficient to specify e.g. "DataFrame.append". message : str Message to be filtered. zignore:N)nameendswith add_markerpytestmarkfilterwarnings)itempathmessages r0ignore_doctest_warningr=ws= yy$  22WWI3FGH r2c|jdxs|jdd}gd}|r|D]}|D]\}}t|||yy)Nz--doctest-modulesz--doctest-cythonF)default))is_int64_dtypezis_int64_dtype is deprecated)is_interval_dtypezis_interval_dtype is deprecated)is_period_dtypezis_period_dtype is deprecated)is_datetime64tz_dtypez#is_datetime64tz_dtype is deprecated)is_categorical_dtypez"is_categorical_dtype is deprecated) is_sparsezis_sparse is deprecated)DataFrameGroupBy.fillnaz%DataFrameGroupBy.fillna is deprecated)NDFrame.replacezThe 'method' keyword)rGzSeries.replace without 'value')z NDFrame.clipz4Downcasting behavior in Series and DataFrame methods)z Series.idxminThe behavior of Series.idxmin)z Series.idxmaxThe behavior of Series.idxmax)zSeriesGroupBy.fillnaz"SeriesGroupBy.fillna is deprecated)zSeriesGroupBy.idxminrH)zSeriesGroupBy.idxmaxrI)zmissing.mask_zero_div_zerozdivide by zero encountered) to_pydatetimez>The behavior of DatetimeProperties.to_pydatetime is deprecated)z pandas.core.generic.NDFrame.boolzY(Series|DataFrame).bool is now deprecated and will be removed in future version of pandas)z!pandas.core.generic.NDFrame.firstzqfirst is deprecated and will be removed in a future version. Please create a mask and filter using `.loc` instead)zResampler.fillnaz+DatetimeIndexResampler.fillna is deprecated)rFz3DataFrameGroupBy.fillna with 'method' is deprecated)rFz,DataFrame.fillna with 'method' is deprecated) read_parquetz1Passing a BlockManager to DataFrame is deprecated) getoptionr=)itemsconfig is_doctestignored_doctest_warningsr:r;r<s r0pytest_collection_modifyitemsrQsg!!"56&:J:JE;K;J - ^D!9 g&tT7;":r2z6.83.2ci)deadlinesuppress_health_checkz)MonthBegin MonthEnd BMonthBegin BMonthEndic)n normalizez%YearBegin YearEnd BYearBegin BYearEnd ) min_value max_value)rVrWmonthz1QuarterBegin QuarterEnd BQuarterBegin BQuarterEndi)rVrW startingMonth)autousec(t|d<t|d<y)z: Make `np` and `pd` names available for doctests. nppdN)rcrd)doctest_namespaces r0add_doctest_importsrfs !d dr2c0tjddy)z< Configure settings for all tests and test modules. chained_assignmentraiseN)rd set_optionr2r0configure_testsrl s MM&0r2)rrZindexcolumnscdt|SNzaxis=reprxs r0rus5a ARr2)paramsidsc|jS)z@ Fixture for returning the axis numbers of a DataFrame. paramrequests r0axisr} ==r2rncdt|Srprqrss r0rurusuT!WI5Fr2c|jS)zA Fixture for returning aliases of axis 1 of a DataFrame. ryr{s r0axis_1rr~r2)TFN)rvc|jS)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). ryr{s r0observedr' ==r2c|jS)z6 Boolean 'ordered' parameter for Categorical. ryr{s r0orderedr4r~r2c|jS)z% Boolean 'skipna' parameter. ryr{s r0skipnar<r~r2)firstlastFc|jS)z[ Valid values for the 'keep' parameter used in .duplicated or .drop_duplicates ryr{s r0keeprD ==r2)bothneitherleftrightc|jS)zA Fixture for trying all interval 'inclusive' parameters. ryr{s r0inclusive_endpoints_fixturerMr~r2)rrrrc|jS)z< Fixture for trying all interval closed parameters. ryr{s r0closedrUr~r2c|jS)zS Secondary closed fixture to allow parametrizing over all pairs of closed. ryr{s r0 other_closedr]r~r2gzipbz2zipxztarzstd zstandard)marksc|jS)zK Fixture for trying common compression types in compression tests. ryr{s r0 compressionre ==r2c|jS)zk Fixture for trying common compression types in compression tests excluding uncompressed case. ryr{s r0compression_onlyrwrr2c|jS)z, Fixture that an array is writable. ryr{s r0writablerr~r2)innerouterrrc|jS)z: Fixture for trying all types of join operations. ryr{s r0 join_typerr~r2nlargest nsmallestc|jS)z1 Fixture for trying all nselect methods. ryr{s r0nselect_methodrr~r2c,t|jSNtype__name__rss r0rurusd1g6F6Fr2c|jS)z/ Fixture for each null type in pandas. ryr{s r0 nulls_fixturerr~r2c|jS)zL Fixture for each null type in pandas, each null type exactly once. ryr{s r0unique_nulls_fixturerr~r2c,t|jSrrrss r0rurusQ8H8Hr2c|jS)z- Fixture for each NaT type in numpy. ryr{s r0np_nat_fixturerr~r2c|jS)z; Fixture to parametrize over DataFrame and Series. ryr{s r0frame_or_seriesrr~r2rmseriesc|jS)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 ryr{s r0index_or_seriesrrr2)rmrarrayc|jS)zG Fixture to parametrize over Index, Series, and ExtensionArray ryr{s r0index_or_series_or_arrayrr~r2c|jSr)rrss r0rurus1::r2c|jS)z] Fixture to test behavior for Index, Series, DataFrame, and pandas Array classes ryr{s r0box_with_arrayrrr2c$Gddt}|S)z, Fixture for a dictionary subclass. ceZdZddZy)"dict_subclass..TestSubDictc6tj|g|i|yr)dict__init__)selfargskwargss r0rz+dict_subclass..TestSubDict.__init__s MM$ 0 0 0r2NreturnNone)r __module__ __qualname__rrkr2r0 TestSubDictrs 1r2r)r)rs r0 dict_subclassrs 1d1 r2c8Gddtj}|S)z8 Fixture for a non-mapping dictionary subclass. c*eZdZddZdZddZddZy) 5non_dict_mapping_subclass..TestNonDictMappingc||_yr)_data)runderlying_dicts r0rz>non_dict_mapping_subclass..TestNonDictMapping.__init__ s (DJr2c8|jj|Sr)r __getitem__)rkeys r0rzAnon_dict_mapping_subclass..TestNonDictMapping.__getitem__s::))#. .r2c6|jjSr)r__iter__rs r0rz>non_dict_mapping_subclass..TestNonDictMapping.__iter__s::&&( (r2c6|jjSr)r__len__rs r0rz=non_dict_mapping_subclass..TestNonDictMapping.__len__s::%%' 'r2Nr)rr')rint)rrrrrrrrkr2r0TestNonDictMappingr s ) / ) (r2r)rMapping)rs r0non_dict_mapping_subclassrs (S[[ ( r2c ttjjdj dt t dttddd }|jd d d gj}|jj|jjDcgc]}|jd c}|_ |jjgdd|Scc}w)z DataFrame with 3 level MultiIndex (year, month, day) covering first 100 business days from 2000-01-01 with random data )dABCDdtype 2000-01-01rBperiodsfreq)rnrmc|jSr)yearrss r0ruzAmultiindex_year_month_day_dataframe_random_data..*sr2c|jSr)r^rss r0ruzAmultiindex_year_month_day_dataframe_random_data..*s177r2c|jSr)dayrss r0ruzAmultiindex_year_month_day_dataframe_random_data..*saeer2i8)rr^rT)inplace)rrcrandom default_rngstandard_normalr#listobjectrgroupbysumrm set_levelslevelsastype set_names)tdfymdlevs r0/multiindex_year_month_day_dataframe_random_datar s  a 00:d6l&1s= C ++'):OL M Q Q SC $$#))BRBR%S3cjj&6%STCIII0$? J&Ts1C6c:tgdgdggdgdgddgS)z; 2-level MultiIndex, lexsorted, with string names. foobarbazquxonetwothree) rrrrZrZrrrr) rrZrrrZrZrrrZrrsecond)rcodesnames)r$rkr2r0%lexsorted_two_level_string_multiindexr1s+ ,.EF-/MN! r2c|}ttjjdj d|t gddS)z2DataFrame with 2 level MultiIndex with random datar) r)ArCexpr4rmrn)rrcrrrr#)rrms r0 multiindex_dataframe_random_datar =s@ 2E  a 009oE2 r2ctgd}tddg}tjgd}tjgd}ddg}t||g||g|d S) zJ MultiIndex used to test the general functionality of this object r rr)rrrZrrr)rrZrrZrrZrrF)rrrverify_integrity)r#rcrr$) major_axis minor_axis major_codes minor_codes index_namess r0_create_multiindexr(Jsh 34Ju~&J((-.K((-.KH%K J'K(  r2c Ztjddgddgtdddggd  S) zB MultiIndex with a level that is a tzaware DatetimeIndex. rZrab20130101r US/Easternrtzr)r)r$ from_productrrkr2r0_create_mi_with_dt64tz_levelr1^s5  " " Q#sZ A,OP% r2stringrpandas_rz 2020-01-01)rz datetime-tzz US/Pacificr.periodDrrz1 day)startrrrangeint8rint16int32int64uint8uint16uint32uint64float32float64z bool-object complex64y? complex128abcde)num)r r r)rZrr)rrrZrZrrInt64UInt16Float32booleanzstring[python]) bool-dtyperBrC categoricalintervalemptytuplesmi-with-dt64tz-levelmultirepeats nullable_int nullable_uintnullable_float nullable_boolz string-pythonzstring[pyarrow]zstring-pyarrowcDt|jjS)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_dictrzcopyr{s r0rmrms  & + + --r2cH|j}t|jS)z8 index fixture, but excluding MultiIndex cases. )rzrYrZ)r|rs r0 index_flatr\s! --C   ! ! ##r2)ruintfloat)r7rOrSrLcPt|jjd}|jj}|jdvrA|j }d|dddz|d<d|dddz|d<t j |Sd|d<d|d<t||S) z Fixture for indices with missing values. Integer-dtype and empty cases are excluded because they cannot hold missing values. MultiIndex is excluded because isna() is not defined for MultiIndex. Tdeep)rPrQrRrrrZN)rYrzrZvaluestolistr$ from_tuplesr)r|indvalss r0index_with_missingrhs. w}} % * * * 5C ::?? D}}CCzz|DGABK'QT"Xab\)R%%d++QRtCyr2c ttjdtjdzt t dDcgc]}d| c}t dScc}w)zC Fixture for Series of floats with Index of unique strings rg?i_rrmr4)rrcarangerAr#r7ris r0 string_seriesrpsM  "BJJ'#-uRy1!r!X1@  1s ActdDcgc]}d| }}ttdDcgc]}d| c}t}t||dtScc}wcc}w)zI Fixture for Series of dtype object with Index of unique strings rjfoo_bar_robjectsrmr4r)r7r#rr)rodatarms r0 object_seriesrws[ !&b *1d1#J *D * uRy1!T!:1 @E $e)6 BB +1s A Acttjjdj dt ddddS)z9 Fixture for Series of floats with DatetimeIndex rrjrrrtsrl)rrcrrrrrkr2r0datetime_seriesrzs=  a 004r<  r2ct|}tjjdj |}t ||ddS)zHelper for the _series dictrr*F)rmr4rZ)lenrcrrrr)rmsizervs r0_create_seriesr~s; u:D 99  # 3 3D 9D $e#E ::r2z series-with-z-indexct|S)zE Fixture for tests on series with changing types of indices. )r~rms r0series_with_simple_indexrs %  r2z-seriesrjzi-r*rucHt|jjdS)z| Fixture for tests on indexes, series and series with a narrow dtype copy to avoid mutation, e.g. setting .name Tr`)_index_or_series_objsrzrZr{s r0index_or_series_objr$s! ! / 4 4$ 4 ??r2cHt|jjdS)z Fixture for tests on indexes, series, series with a narrow dtype and series with empty objects type copy to avoid mutation, e.g. setting .name Tr`)_index_or_series_memory_objsrzrZr{s r0index_or_series_memory_objr:s! ( 6 ; ; ; FFr2c ttjdtjt t dDcgc]}d| c}t t tdt Scc}w)zj Fixture for DataFrame of ints with index of unique strings Columns are ['A', 'B', 'C', 'D'] rjrrrjrrrr)rrconesr;r#r7rrrns r0 int_framerGsS  rxx(r3AtA3Z36Bd6l&1 3s A3c ttjjdj dt t dDcgc]}d| c}t tdScc}w)zm Fixture for DataFrame of floats with index of unique strings Columns are ['A', 'B', 'C', 'D']. rrrjrrrr)rrcrrrr#r7rrns r0 float_framerUsZ  a 009r3AtA3Z34d6l# 3s A0cztdddtdddtdddtdddtdddtdddtdddtdddtdddtdddg }ttjj dj t ||S)zF Fixture for Series with a DatetimeIndex that has duplicates. irZrrrrYr)rrrcrrrr|)datess r0(rand_series_with_duplicate_datetimeindexrcs q!q!q!q!q!q!q!q!q!q! E "))''*::3u:Fe TTr2)rrrg?g?z2012-01M)rz period[M]z 2012-02-01z period[D]z 2011-01-01r-)r/s)unitr/i)secondsztimedelta64[ns]c|jSrryr{s r0ea_scalar_and_dtyper{ ==r2c|jS)zD Fixture for dunder names for common arithmetic operations. ryr{s r0all_arithmetic_operatorsrr~r2c|jS)zU Fixture for operator and roperator arithmetic, comparison, and logical ops. ryr{s r0all_binary_operatorsrD ==r2c|jS)z Fixture for operator and roperator arithmetic functions. Notes ----- This includes divmod and rdivmod, whereas all_arithmetic_operators does not. ryr{s r0all_arithmetic_functionsrs6 ==r2) countrmaxminmeanprodstdvarmediankurtskewsemc|jS)z. Fixture for numeric reduction names. ryr{s r0all_numeric_reductionsrr~r2allanyc|jS)z. Fixture for boolean reduction names. ryr{s r0all_boolean_reductionsrr~r2c|jS)z> Fixture for all (boolean + numeric) reduction names. ryr{s r0all_reductionsrr~r2c|jS)z; Fixture for operator module comparison functions. ryr{s r0 comparison_opr rr2)__le____lt____ge____gt__c|jS)zm Fixture for dunder names for compare operations except == and != * >= * > * < * <= ryr{s r0compare_operators_no_eq_nerrr2)__and____rand____or____ror____xor____rxor__c|jS)zY Fixture for dunder names for common logical operations * | * & * ^ ryr{s r0all_logical_operatorsr( ==r2)cumsumcumprodcummincummaxc|jS)z0 Fixture for numeric accumulation names ryr{s r0all_numeric_accumulationsr9r~r2c$|jdS)zR Returns the configuration for the test setting `--no-strict-data-files`. r*)rL) pytestconfigs r0strict_data_filesrDs  ! !": ;;r2ctjjtjjtdfd}|S)aD 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 --no-strict-data-files option is not set. testsctjjg|}tjj|s*rt d|dt j d|d|S)NzCould not find file z' and --no-strict-data-files is not set.zCould not find .)osr;joinexists ValueErrorr7skip)rr; BASE_PATHrs r0decozdatapath..decoascww||I--ww~~d#  *4&0WX KK/$q1 2 r2)rr;rdirname__file__)rrrs` @r0datapathrLs2& RWW__X6@I Kr2z Asia/Tokyozdateutil/US/Pacificzdateutil/Asia/Singaporez+01:15z-02:15z UTC+01:15z UTC-02:15i,i)hoursrbr rc|jS)zD Fixture for trying timezones including default (None): {0} ryr{s r0tz_naive_fixturerrr2c|jS)z4 Fixture for trying explicit timezones: {0} ryr{s r0tz_aware_fixturerrr2rz dateutil/UTCc|jS)zQ Fixture to provide variants of UTC timezone strings and tzinfo objects. ryr{s r0 utc_fixturerr~r2)rmsusnsc|jS)z& datetime64 units we support. ryr{s r0rrr~r2c|jS)zR Parametrized fixture for string dtypes. * str * 'str' * 'U' ryr{s r0 string_dtyper ==r2pyarrowc|jS)za Parametrized fixture for string dtypes. * 'string[python]' * 'string[pyarrow]' ryr{s r0nullable_string_dtyper ==r2python pyarrow_numpyc|jS)zx Parametrized fixture for pd.options.mode.string_storage. * 'python' * 'pyarrow' * 'pyarrow_numpy' ryr{s r0string_storagerrr2numpy_nullablec|jS)zb Parametrized fixture for pd.options.mode.string_storage. * 'python' * 'pyarrow' ryr{s r0 dtype_backendrrr2c|jS)zK Parametrized fixture for bytes dtypes. * bytes * 'bytes' ryr{s r0 bytes_dtyper ==r2c|jS)zN Parametrized fixture for object dtypes. * object * 'object' ryr{s r0 object_dtyperrr2rzstring[pyarrow_numpy]c|jS)zo Parametrized fixture for string dtypes. * 'object' * 'string[python]' * 'string[pyarrow]' ryr{s r0any_string_dtyperrr2c|jS)z\ Parametrized fixture for datetime64 dtypes. * 'datetime64[ns]' * 'M8[ns]' ryr{s r0datetime64_dtyper-rr2c|jS)z^ Parametrized fixture for timedelta64 dtypes. * 'timedelta64[ns]' * 'm8[ns]' ryr{s r0timedelta64_dtyper8rr2c &tdddddddS)z- Fixture emits fixed Timestamp.now() irZr[r )rr^rhourminuter microsecond)rrkr2r0 fixed_now_tsrCs  1RR r2c|jS)z^ Parameterized fixture for float dtypes. * float * 'float32' * 'float64' ryr{s r0float_numpy_dtyperMrr2c|jS)zR Parameterized fixture for float dtypes. * 'Float32' * 'Float64' ryr{s r0float_ea_dtyperYrr2c|jS)z~ Parameterized fixture for float dtypes. * float * 'float32' * 'float64' * 'Float32' * 'Float64' ryr{s r0any_float_dtyper drr2c|jS)zg Parameterized fixture for complex dtypes. * complex * 'complex64' * 'complex128' ryr{s r0 complex_dtyper rrr2c|jS)z| Parameterized fixture for signed integer dtypes. * int * 'int8' * 'int16' * 'int32' * 'int64' ryr{s r0any_signed_int_numpy_dtyper~rr2c|jS)zx Parameterized fixture for unsigned integer dtypes. * 'uint8' * 'uint16' * 'uint32' * 'uint64' ryr{s r0any_unsigned_int_numpy_dtyperrr2c|jS)z Parameterized fixture for any integer dtype. * int * 'int8' * 'uint8' * 'int16' * 'uint16' * 'int32' * 'uint32' * 'int64' * 'uint64' ryr{s r0any_int_numpy_dtyperrr2c|jS)z Parameterized fixture for any nullable integer dtype. * 'UInt8' * 'Int8' * 'UInt16' * 'Int16' * 'UInt32' * 'Int32' * 'UInt64' * 'Int64' ryr{s r0any_int_ea_dtyperrr2c|jS)a. Parameterized fixture for any nullable integer dtype. * int * 'int8' * 'uint8' * 'int16' * 'uint16' * 'int32' * 'uint32' * 'int64' * 'uint64' * 'UInt8' * 'Int8' * 'UInt16' * 'Int16' * 'UInt32' * 'Int32' * 'UInt64' * 'Int64' ryr{s r0 any_int_dtypers. ==r2c|jS)z Parameterized fixture for any nullable integer dtype and any float ea dtypes. * 'UInt8' * 'Int8' * 'UInt16' * 'Int16' * 'UInt32' * 'Int32' * 'UInt64' * 'Int64' * 'Float32' * 'Float64' ryr{s r0any_numeric_ea_dtypers" ==r2c|jS)a Parameterized fixture for any nullable integer dtype and any float ea dtypes. * 'UInt8' * 'Int8' * 'UInt16' * 'Int16' * 'UInt32' * 'Int32' * 'UInt64' * 'Int64' * 'Float32' * 'Float64' * 'uint8[pyarrow]' * 'int8[pyarrow]' * 'uint16[pyarrow]' * 'int16[pyarrow]' * 'uint32[pyarrow]' * 'int32[pyarrow]' * 'uint64[pyarrow]' * 'int64[pyarrow]' * 'float32[pyarrow]' * 'float64[pyarrow]' ryr{s r0any_numeric_ea_and_arrow_dtypers@ ==r2c|jS)z~ Parameterized fixture for any signed nullable integer dtype. * 'Int8' * 'Int16' * 'Int32' * 'Int64' ryr{s r0any_signed_int_ea_dtyperrr2c|jS)z Parameterized fixture for any (purely) real numeric dtype. * int * 'int8' * 'uint8' * 'int16' * 'uint16' * 'int32' * 'uint32' * 'int64' * 'uint64' * float * 'float32' * 'float64' ryr{s r0any_real_numpy_dtypers$ ==r2c|jS)a  Parameterized fixture for any (purely) real numeric dtype. * int * 'int8' * 'uint8' * 'int16' * 'uint16' * 'int32' * 'uint32' * 'int64' * 'uint64' * float * 'float32' * 'float64' and associated ea dtypes. ryr{s r0any_real_numeric_dtyper 1s( ==r2c|jS)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' ryr{s r0any_numpy_dtyper"Hrr2c|jS)a Parameterized fixture for all real dtypes that can hold NA. * float * 'float32' * 'float64' * 'Float32' * 'Float64' * 'UInt8' * 'UInt16' * 'UInt32' * 'UInt64' * 'Int8' * 'Int16' * 'Int32' * 'Int64' * 'uint8[pyarrow]' * 'uint16[pyarrow]' * 'uint32[pyarrow]' * 'uint64[pyarrow]' * 'int8[pyarrow]' * 'int16[pyarrow]' * 'int32[pyarrow]' * 'int64[pyarrow]' * 'float[pyarrow]' * 'double[pyarrow]' ryr{s r0any_real_nullable_dtyper$ms: ==r2c|jS)a Parameterized fixture for all numeric dtypes. * int * 'int8' * 'uint8' * 'int16' * 'uint16' * 'int32' * 'uint32' * 'int64' * 'uint64' * float * 'float32' * 'float64' * complex * 'complex64' * 'complex128' * 'UInt8' * 'Int8' * 'UInt16' * 'Int16' * 'UInt32' * 'Int32' * 'UInt64' * 'Int64' * 'Float32' * 'Float64' ryr{s r0any_numeric_dtyper&s> ==r2cmixedbytesacrOz mixed-integerrg@floatingg?integerzmixed-integer-floatdecimal datetime64z 2013-01-01z 2018-01-01r,20180101riicomplexy??y@@rrNc^|j\}}tj|t}||fS)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 -------- >>> from pandas._libs import 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)rzrcrr)r|inferred_dtypercs r0any_skipna_inferred_dtyper4s0R%]]NF XXfF +F 6 !!r2ctjddddlm}ddlm}|}d|j _||S) zj Get an instance of IPython.InteractiveShell. Will raise a skip if IPython is not installed. IPythonz6.0.0) minversionr)InteractiveShell)Configz:memory:)rN)r7 importorskipIPython.core.interactiveshellr8traitlets.configr9HistoryManager hist_file)r8r9r's r0ipr?s<  g6>(A!+A 1 %%r2)bsrcoocsccsrdiadoklilc^tjd}t||jdzS)z- Yields scipy sparse matrix classes. z scipy.sparse_matrix)r7r:getattrrz)r|sparses r0spmatrixrKs*   0F 67==94 55r2Tickc|jS)zN Fixture for Tick based datetime offsets available for a time series. ryr{s r0 tick_classesrNrr2c|Srrkrss r0ruru,sr2c|jS)zk Simple fixture for testing keys in sorting methods. Tests None (no key) and the identity key. ryr{s r0 sort_by_keyrQ,rr2)r NN)EgonVenkmanN)NCC1701DrTrTc|jS)zP A 3-tuple of names, the first two for operands, the last for a result. ryr{s r0rr5s ==r2c|jS)zI Parametrize over __setitem__, loc.__setitem__, iloc.__setitem__ ryr{s r0 indexer_slirWHr~r2c|jS)z< Parametrize over loc.__getitem__, iloc.__getitem__ ryr{s r0 indexer_lirYPr~r2c|jS)z8 Parametrize over __setitem__, iloc.__setitem__ ryr{s r0 indexer_sir[Xr~r2c|jS)z7 Parametrize over __setitem__, loc.__setitem__ ryr{s r0 indexer_slr]`r~r2c|jS)z: Parametrize over at.__setitem__, loc.__setitem__ ryr{s r0 indexer_alr_hr~r2c|jS)z< Parametrize over iat.__setitem__, iloc.__setitem__ ryr{s r0 indexer_ialrapr~r2c"tdddk(S)z> Fixture to check if the array manager is being used. mode.data_managerTsilentrrrkr2r0using_array_managerrfxs *4 8G CCr2crtjjjduxrt dddk(S)z7 Fixture to check if Copy-on-Write is enabled. Trcrdblockrdoptionsmode copy_on_writerrkr2r0using_copy_on_writerms5 %%- E +D 9W Dr2cttjjjdk(xrt dddk(S)z? Fixture to check if Copy-on-Write is in warning mode. warnrcTrdrhrirkr2r0warn_copy_on_writerps5 %%/ E +D 9W Dr2cNtjjjduS)z= Fixture to check if infer string option is enabled. T)rdrjfuture infer_stringrkr2r0using_infer_stringrts ::   ) )T 11r2z Europe/Warsawzdateutil/Europe/Warsawc|jS)zE tzinfo for Europe/Warsaw using pytz, dateutil, or zoneinfo. ryr{s r0warsawrvr~r2cy)N)rrrkrkr2r0arrow_string_storagerxs 'r2r)r:z pytest.Itemr;strr<ryrr)rz type[dict])rztype[abc.Mapping])rr$)rr)rr)rryrzCallable[..., str])rr)rz#tuple[Hashable, Hashable, Hashable])rbool)rry(>__doc__ __future__r collectionsrrrrrr r.r operatorrtypingr r dateutil.tzr r hypothesisrstnumpyrcr7pytzrrpandas._config.configrpandas.util._test_decoratorsutil_test_decoratorstdpandas.core.dtypes.dtypesrrpandasrdrrrrrrrrrrr r!pandas._testing_testingtm pandas.corer"pandas.core.indexes.apir#r$pandas.util.versionr%collections.abcr&r'rpa has_pyarrow ImportErrorzoneinfoZoneInfoZoneInfoNotFoundErrorr1r=rQ HealthChecktoo_slowhypothesis_health_checks __version__appenddiffering_executorssettingsregister_profiletuple load_profilesplitr4rItseriesoffsetsclsregister_type_strategybuildsintegersbooleansfixturerfrlr} axis_framerrrrrrrrrz skip_if_norrrrr NULL_OBJECTSrnulls_fixture2nanNaTrunique_nulls_fixture2NP_NAT_OBJECTSrnp_nat_fixture2rrindex_or_series2rrrbox_with_array2rrr rr r(r1r7rmrrzr from_breakslinspacererrrYidxkeysrmindex_fixture2rM isinstancer\ index_flat2 startswithrhrprwrzr~_seriesrNARROW_NP_DTYPESr_narrow_seriesrrPYTHON_DATA_TYPES_typ_objects_seriesrrrrrrarithmetic_dunder_methodsraddraddsubrsubmulrmultruedivrtruedivfloordiv rfloordivmodrmodpowrpoweqneltlegtgeand_rand_xorrxoror_ror_rr_all_numeric_reductionsr_all_boolean_reductionsr_all_reductionsrrrr_all_numeric_accumulationsrrr TIMEZONESextendrr TIMEZONE_IDSparametrize_fixture_docryrrtz_aware_fixture2_UTCSr utc_fixture2runit2 STRING_DTYPESrrrrstring_storage2 BYTES_DTYPESr OBJECT_DTYPESrrDATETIME64_DTYPESrTIMEDELTA64_DTYPESrrFLOAT_NUMPY_DTYPESrFLOAT_EA_DTYPESrALL_FLOAT_DTYPESr COMPLEX_DTYPESr SIGNED_INT_NUMPY_DTYPESrUNSIGNED_INT_NUMPY_DTYPESrALL_INT_NUMPY_DTYPESrALL_INT_EA_DTYPESrALL_INT_DTYPESrrALL_INT_PYARROW_DTYPES_STR_REPRFLOAT_PYARROW_DTYPES_STR_REPRrSIGNED_INT_EA_DTYPESrALL_REAL_NUMPY_DTYPESrALL_REAL_DTYPESr ALL_NUMPY_DTYPESr"ALL_REAL_NULLABLE_DTYPESr$ALL_NUMERIC_DTYPESr&NAr/_any_skipna_inferred_dtyperw_r4r?rK__all__ issubclassrLrNrQrsetitemlocilocrWrYr[r]atr_iatrarfrmrprtwarsawsrvrx)rorvalueindex_idrmros0000000r0rsY&#  '  .))     (  KHeI$9        V=2==#=>    e}%&:;< K012r,FGHbffbff-./-r((.HIJ! 6*+,vWh,?@ A #vrxx06RSTvy"((;AUVW!  0"   (' eE#J7qwqc]78' <5':lCLI' l<3? ' w#F '  Z_ ' E)"))C. /' U9299S> 1' U9299S> 1' U9299S> 1' U9299S> 1' eIBIIcN(3' eIBIIcN(3' eIBIIcN(3'uYRYYs^95' uYRYYs^95!'"5$*&9#'$u )6 #[)D9299S 3T,TT #\*TIBIIc4V-VV$DL2$56) ))+"++a#*FG 2Y$j$$S)> %JK8:  !'()"))C.89299S>:IBIIcN)<9299S>006iHs4AGA3-4;O;O27u~~gu -        388:;G<G    UU. q "M'7$CD s# & i(IJ   $k2  3 '5 l| 4  6  3 !23   r3345                        5 <=<             $ %$   ./0!%../0*,CC'(         ?@ A  NG123<<J     G IN LL YQ   YR u-%  (   H  l + H  e $  "++AQ+ C -.yl34/C QR 012y},qr*:;<3% UWhll;  LL"""5)*u ./0  r''() &mbmmI.FG     YmbmmI&>? _MBMM),DE  YmbmmI&>?    !r'(r''() &mbmmI.FG ,MBMM)4LM  r++,-r,,-.r,,-.r))*+r**+ , r(()*r112 3 r334 5 r../0"r++, -  r(()*2r++b.@.@@AB*   (( ) && '   :r../ 0 r//01(r))*+,r**+!,!Hr2234>r,,-.FRVVS!" RUUC ! sBFFC ! tRVVT"# rvvrvvrvv&' bMsBFFA&' sBFFC !#rvvs#$BFFAQ,-RVVWQZ01rvvu%&ruue$%MBMM,/|9TUV)J':1FGH d4AT1a(8 9:()9Q<167 d1grvvtAw '( t bfffTl34(1a."&&(1a.9:36 ( )Q1s;,"<,"d&&$HI6J6##  gbjj!,bjjoo >1;  A k*+,!,    ruu    BFFBGG456()* BGG,-. BFF+,-rvv'(()*DD22 4 5  NN$8$$_56w ((c:K%%HJ8H5=0 " `  7(~ ,f s1Ao0=Ao> Ap 5 Ap*, Ap Ap% &Ap% +Ap+ (Ap1''Ap< Ap7 Ap<)AqB AqcAAq o0Ao;o:Ao;o>AppApp7Ap<