`L ik;dZddlZddlZddlZddlZddlZddlZddlmZ ddl Z ddl m ZddlmZdej"d zd k(Zej&d vZeej*Zeej.Zeej*Zeej.Zej6j8ej6j:gZej6j>ej6j@gZ!ej6jDej6jFgZ$ej6jJej6jLgZ'ej6jPej6jRgZ*ej6jVej6jXgZ-ej6j\ej6j^gZ0 dd l1m2Z2d Z3dZ4d'dZ5eedk\r!ej6jljnZ8ndZ8dZ9eedk\rdZ:dZ;ndZdZ:dZ;eedk\r ddl?m@Z@mAZAnddlm@Z@mAZAdZBdZCd(d ZDeed!krdd"lEmFZFndd"lGmFZFd#ZHd$ZId%ZJdZK ddlLZLeeLj*ZMeMed&krd ZKyy#e $rdZ YwxYw#e $rdZ3YwxYw#eN$rYywxYw))zCompatibility fixes for older version of python, numpy and scipy If you add content to this file, please give the version of the package at which the fix is no longer needed. N)optimize)parse)_get_threadpool_controllerP )wasm32wasm64)sparrayTFc ||k7SN)Xs Y/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sklearn/utils/fixes.py_object_dtype_isnanr6s 6Mcttdk\rMtjj ||d}ttdk\r|t j |}|Stjj ||S)N1.9.0T)axiskeepdimsz1.10.999r) sp_version parse_versionscipystatsmodenpravel)arrs r_moder";sj]7++{{t< z2 2|xx~ ;;  AD  ))rz1.12.0c d|vr|jd|d<d|vrd|d<tjjj||fi|S)Nrtoltolatollegacy)poprsparselinalgcg)Abkwargss r_sparse_linalg_cgr/LsO V "JJv.F5M  %F6N||""%%a5f55rcd}tt|krtj|dStj j |d\}}|S)aEstimate the optimal Yeo-Johnson transformation parameter (lambda). This function provides a compatibility workaround for versions of SciPy older than 1.9.0, where `scipy.stats.yeojohnson` did not return the estimated lambda directly. Parameters ---------- _neg_log_likelihood : callable A function that computes the negative log-likelihood of the Yeo-Johnson transformation for a given lambda. Used only for SciPy versions < 1.9.0. x : array-like Input data to estimate the Yeo-Johnson transformation parameter. Returns ------- lmbda : float The estimated lambda parameter for the Yeo-Johnson transformation. r)r)brackN)lmbda)rrrbrentrr yeojohnson)_neg_log_likelihoodxmin_scipy_version_r3s r_yeojohnson_lambdar:UsL* M"344~~1AA{{%%at%4HAu Lrz1.11.0c|j|}|j|}|<|jj}|jj}||fSNr)minmaxtoarrayr rrthe_minthe_maxs r_sparse_min_maxrCys]%%T%"%%T%"  oo'--/Goo'--/Grc|j|}|j|}|<|jj}|jj}||fSr<)nanminnanmaxr?r r@s r_sparse_nan_min_maxrGs](((%(((%  oo'--/Goo'--/Grc<tjtj|j}t ||j |j |jf|j}|j|j |j|}||fS)N)shape) r flatnonzerodiffindptrtypedataindicesrIreduceat)rufunc major_indexvalues r _minor_reducerTspnnRWWQXX%67 DGQVVQYY1 Aqvvqxx '<=E!!rc 6|j|}|dk(r td|jd|z }|dk(r|jn|j}|j t ||\}}t j|j||k}|||d||<|dk7} t j| |}t j| |}|dk(rOtjj|t jt||ff|jd|f} nNtjj||t jt|ff|j|df} | j!j#S)Nr&zero-size array to reduction operationr)dtyperI)rI ValueErrortocsctocsrsum_duplicatesrTrrKrLcompressrr) coo_matrixzeroslenrWr?r ) rr min_or_maxNMmatrRrSnot_fullmaskress r_min_or_max_axisrgse GGDM 6EF F GGAH 19aggi!'') *3 ; U773::&{3a7$U8_a8hzkk$ 4  D%( 19,,))#e*-{;<gg!f*C ,,))bhhs5z&:;<gg!f*C {{}""$$rc|d|jvr td|jjd}|jdk(r|S|j |j j}|jtj|jk7r |||}|S|dkr|dz }|dk(s|dk(r t|||Std)NrrVrrz.invalid axis, use 0 for rows, or 1 for columns) rIrXrWrMnnzreducerNr rprodrg)rrr`zeroms r_sparse_min_or_maxrns <AGG| !IJJ77<<?Duuz !!!&&,,.1Auu((tQ'H !8 AID AI419#AtZ8 8MN Nrcnt||tjt||tjfSr)rnrminimummaximumrrs rrCrCs, q$ 3 q$ 3  rcnt||tjt||tjfSr)rnrfminfmaxrrs rrGrGs, q$ 0 q$ 0  rz1.25.0)ComplexWarningVisibleDeprecationWarningct|jj}t|tdkr"|jtj }|St|tdk\rinddi}|j dd5|jtj jdi|}ddd|S#1swY|SxYw) Nz2.2)rS3copyFzfuture.no_silent_downcastingTr)r __version__ base_versionfillnarnanoption_context infer_objects)pdframe pd_versioninfer_objects_kwargss r pd_fillnarsr~~.;;JZ =#77 266 * L  +}S/AABPU R  =t D UrirIastyperowcol)sparse_containeroriginal_container_formatrequested_sparse_format index_dtypes r_preserve_dia_indices_dtypers,!K/4KP5 #e +:(//1A1I1IJ+//1A1G1G1JK#K (8'?'?'F'F%(G(  $'7&=&=&D&D%'E'  #;+112K$4#7#7#>#>{QV#>#W  #3#7#7#>#>{QV#>#W  +5/rc(tjtjtjj}tjtjtjj}|T|tjtj jkDrt d|d||kDrtj St|tjr|f}|D] }t|tjstdt|dtj|jtjst d|jdtj|jtjr|stj cS|jdk(r|j }|j}||ks||kDstj cStjS)a}Based on input (integer) arrays `a`, determine a suitable index data type that can hold the data in the arrays. This function returns `np.int64` if it either required by `maxval` or based on the largest precision of the dtype of the arrays passed as argument, or by their contents (when `check_contents is True`). If none of the condition requires `np.int64` then this function returns `np.int32`. Parameters ---------- arrays : ndarray or tuple of ndarrays, default=() Input arrays whose types/contents to check. maxval : float, default=None Maximum value needed. check_contents : bool, default=False Whether to check the values in the arrays and not just their types. By default, check only the types. Returns ------- dtype : {np.int32, np.int64} Suitable index data type (int32 or int64). zmaxval=z+ is to large to be represented as np.int64.z)Arrays should be of type np.ndarray, got z instead.z Array dtype z= is not supported for index dtype. We expect integral values.r)rint32iinfor=r>int64rX isinstancendarray TypeErrorrM issubdtyperWintegercan_castsize)rrrint32minint32maxarrminvals rrrs6xx*../Hxx*../H  BHHRXX&** *&!LM  H 88O&"**%$#rzz*;DI;iP }}SYY 3syyk*## {{399bhh/!xxxx1}H$(988O/$2 88Orz1.12) laplaciancl |j|dy#t$r|j|YywxYw)NrN)filter) extractallr)tarfilepaths rtarfile_extractallrms9! 4/ !4 !s 33c ddl}ddl}tj}t d|D}|syt d}|D]I}|ddk7r |j d}|j d }||y |d k(s:t ||ksIy y) z8Return True if in an unstable configuration for OpenBLASrNc3,K|] }|ddk(yw) internal_apiopenblasNr).0infos r z6_in_unstable_openblas_configuration..sUn-;UsFz0.3.16rrversion architectureT neoversen1)numpyrrranyrget)rr modules_infoopen_blas_usedopenblas_arm64_stable_versionropenblas_versionopenblas_architectures r#_in_unstable_openblas_configurationrws-/446LU UUN %2($;!   : - 88I. $ 8  #'<'D !\ 1./2OO  rc2ttdk\riS||iS)Nz1.15)rr)keyrSs r"_get_additional_lbfgs_options_dictrs}V442F3,Frz17.0.0)r)rNF)O__doc__platformstructrrrscipy.sparse.linalg scipy.statsrpandasr ImportErrorexternals._packaging.versionrrparallelrcalcsize _IS_32BITmachine_IS_WASMr{ np_versionr|np_base_versionrsp_base_versionr) csr_matrix csr_arrayCSR_CONTAINERS csc_matrix csc_arrayCSC_CONTAINERSr] coo_arrayCOO_CONTAINERS lil_matrix lil_arrayLIL_CONTAINERS dok_matrix dok_arrayDOK_CONTAINERS bsr_matrix bsr_arrayBSR_CONTAINERS dia_matrixrDIA_CONTAINERS scipy.sparser SPARRAY_PRESENTrr"r*r+r/r:rCrGrTrgrnnumpy.exceptionsrvrwrrrexternals._scipy.sparse.csgraphrscipy.sparse.csgraphrrrPYARROW_VERSION_BELOW_17pyarrowpyarrow_versionModuleNotFoundErrorrrrrs  B0 $ $ * 8   !5 5 2>> *  7 78 5,, -  7 78,,))5<<+A+AB,,))5<<+A+AB,,))5<<+A+AB,,))5<<+A+AB,,))5<<+A+AB,,))5<<+A+AB,,))5<<+A+AB$O  *mH-- ++..6DmH--  "%8O$  x((JJ +X^BL f%%; !NG ! #G$7$78Ox00#' 1g  B:Op   s5J+J9#K+J65J69KKK K