
    Гh-                         S r SSKrSSKrSSKJrJrJrJr  SSKrSSK	J
r
  \R                  " S5      rS\\\4   SS	S
\4S jrS\\\\4      S\
S
\\\   \4   4S jrg)z)Utilities for the XGBoost Dask interface.    N)AnyDictOptionalTuple   )Configz[xgboost.dask]local_paramworkerzdistributed.Workerreturnc                 "   [        US5      (       a  UR                  R                  OUR                  nSnS HH  nU R                  US5      c  M  U R                  XB5      U:w  d  M/  [        R                  S5        X   n  O   US:X  d  Uc  UnU$ )zIGet the number of threads from a worker and the user-supplied parameters.stateN)nthreadn_jobsz-Overriding `nthreads` defined in dask worker.r   )hasattrr   nthreadsgetLOGGERinfo)r	   r
   dwnt	n_threadsps        eC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\xgboost/dask/utils.pyget_n_threadsr      s     %,FG$<$<6<<  &//DI"??1d#/KOOA4LPT4TKKGH#I	 #
 A~*	    dconfigcoll_cfgc                    S/nSnSnU b<  U  H5  nXR;  a  [        SU 35      e[        R                  " SU S3[        5        M7     O0 n U R	                  SS5      nUb1  UR                  S5      (       a  UR                  S5      (       a  US	S
 nUb"   [        R                  R                  U5      u  p4Uc
  [        5       nUR                  b;  Ub,  UR                  U:w  a  [        SU SUR                   S35      eUR                  nUR                  bP  US:w  a>  Ub;  UR                  S:w  a+  XAR                  :w  a  [        SU SUR                   S35      eUR                  nX44$ ! [          a     Nf = f)zGet the tracker address from the optional user configuration.

Parameters
----------
dconfig :
    Dask global configuration.

coll_cfg :
    Collective configuration.

Returns
-------
The IP address along with the port number.

scheduler_addressNr   zUnknown configuration: zeUse `coll_cfg` instead of the Dask global configuration store for the XGBoost tracker configuration: .[]   z\Conflicting host IP addresses from the dask configuration and the collective configuration: z v.s. zPConflicting ports from the dask configuration and the collective configuration: )
ValueErrorwarningswarnFutureWarningr   
startswithendswithdistributedcommget_address_host_portr   tracker_host_iptracker_port)r   r   valid_confighost_ipportks         r   get_address_from_userr3      s   & ((LGDA$ #:1#!>??MM??@cD   kk-t4Gw11#667;K;KC;P;P!B-	',,BB7KMG 8+8#;#;w#F--4IVH<T<T;UUVX  **(AI %%*-----1F&9N9N8OqR  $$=3  		s   !E) )
E65E6)__doc__loggingr%   typingr   r   r   r   r*   
collectiver   	getLoggerr   strintr   r3    r   r   <module>r<      s    /   - -  			+	,tCH~ 7K PS Fd38n%F17F
8C=#Fr   