L i@ddlmZddlZddlmZmZer&ddlZddlmZ ddl Z ddl m Z ddl ZddlZddlZddlmZddlmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%ddZ&ddZ'ddZ(dd Z)dd Z*dd Z+dd Z,dd Z-ddZ.ddZ/d dZ0d!dZ1d"dZ2d#dZ3d$dZ4gdZ5y)%) annotationsN) TYPE_CHECKINGAny)TypeIs) IMPORT_HOOKSget_cudfget_dask_dataframeget_ibis get_modin get_numpy get_pandas get_polars get_pyarrowis_into_dataframeis_into_seriesis_narwhals_dataframeis_narwhals_lazyframeis_narwhals_seriesis_numpy_arrayis_pandas_indexctx}duxrt|jxstfdtDS)zBCheck whether `df` is a pandas DataFrame without importing pandas.Nc3K|]J}tjj|dxduxr tjj LywN)sysmodulesget isinstancepandas DataFrame).0 module_namedfmods e/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/narwhals/stable/v1/dependencies.py z&is_pandas_dataframe..'sTV   T2 24? 1 r3::// 0 1VAA)r rranyr)r"pdr#s` @r$is_pandas_dataframer)%sF< R , MB 1M RUV(VSctx}duxrt|jxstfdtDS)z@Check whether `ser` is a pandas Series without importing pandas.Nc3K|]J}tjj|dxduxr tjj Lywr)rrrrrSeries)r r!r#sers r$r%z#is_pandas_series..0sTT   T2 24? / sCJJ-- . /Tr&)r rr-r'r)r.r(r#s` @r$is_pandas_seriesr/.sF< R , KC1K PST(TQr*cNtx}duxrt||jS)z@Check whether `df` is a modin DataFrame without importing modin.N)r rr)r"mpds r$is_modin_dataframer27s$; Ct + M 2s}}0MMr*cNtx}duxrt||jS)z>Check whether `ser` is a modin Series without importing modin.N)r rr-)r.r1s r$is_modin_seriesr4<s$; Ct + K 3 0KKr*cNtx}duxrt||jS)z>Check whether `df` is a cudf DataFrame without importing cudf.N)rrr)r"cudfs r$is_cudf_dataframer7As$J Dt + N 2t~~0NNr*cNtx}duxrt||jS)zCheck whether `df` is a Dask DataFrame without importing Dask.N)r rr)r"dds r$is_dask_dataframer<Ks%$& &Bt 3 T 2r||8TTr*cvtx}duxr*t||jjjS)z:Check whether `df` is a Ibis Table without importing Ibis.N)r rexprtypesTable)r"ibiss r$ is_ibis_tablerBPs.J Dt + U 2tyy?T?T0UUr*cNtx}duxrt||jS)zBCheck whether `df` is a Polars DataFrame without importing Polars.N)rrrr"pls r$is_polars_dataframerFU$, Bt + L 2r||0LLr*cNtx}duxrt||jS)zBCheck whether `df` is a Polars LazyFrame without importing Polars.N)rr LazyFramerDs r$is_polars_lazyframerJZrGr*cNtx}duxrt||jS)z@Check whether `ser` is a Polars Series without importing Polars.N)rrr-)r.rEs r$is_polars_seriesrL_s$, Bt + J 3 0JJr*cNtx}duxrt||jS)zHCheck whether `ser` is a PyArrow ChunkedArray without importing PyArrow.N)rr ChunkedArray)r.pas r$is_pyarrow_chunked_arrayrPds$- B , QC1QQr*cNtx}duxrt||jS)z@Check whether `df` is a PyArrow Table without importing PyArrow.N)rrr@)r"rOs r$is_pyarrow_tablerRis$- B , IB1IIr*cLt|xst|xs t|S)zCheck whether `df` is a pandas-like DataFrame without doing any imports. By "pandas-like", we mean: pandas, Modin, cuDF. )r)r2r7)r"s r$is_pandas_like_dataframerTns& r " U&8&< U@QRT@UUr*cLt|xst|xs t|S)zCheck whether `ser` is a pandas-like Series without doing any imports. By "pandas-like", we mean: pandas, Modin, cuDF. )r/r4r9)r.s r$is_pandas_like_seriesrVvs# C OOC$8 ON3rds" %((N L O M U V M M K R J VP r*