Ë
    ®Ó^jî  ã                   óÌ   — d Z ddlZddlmZ ddlmZmZmZ ddlm	Z	m
Z
mZmZ ddlmZ  G d„ d	e«      Zedddd
ddœdededee   dee   dee   dededeeeef      fd„«       Zy)z4XGBoost Experimental Federated Learning related API.é    N)ÚThread)ÚAnyÚDictÚOptionalé   )Ú_LIBÚ_check_callÚ_deprecate_positional_argsÚmake_jcargs)ÚRabitTrackerc                   ó`   — e Zd ZdZedddddœdedededee   d	ee   d
ee   deddfd„«       Z	y)ÚFederatedTrackera÷  Tracker for federated training.

    Parameters
    ----------
    n_workers :
        The number of federated workers.

    port :
        The port to listen on.

    secure :
        Whether this is a secure instance. If True, then the following arguments for SSL
        must be provided.

    server_key_path :
        Path to the server private key file.

    server_cert_path :
        Path to the server certificate file.

    client_cert_path :
        Path to the client certificate file.

    Né,  )Úserver_key_pathÚserver_cert_pathÚclient_cert_pathÚtimeoutÚ	n_workersÚportÚsecurer   r   r   r   Úreturnc                óÖ   — t        j                  «       }t        ||d||||t        |«      ¬«      }	t	        t        j                  |	t        j                  |«      «      «       || _        y )NÚ	federated)r   r   Údmlc_communicatorÚfederated_securer   r   r   r   )	ÚctypesÚc_void_pr   Úintr	   r   ÚXGTrackerCreateÚbyrefÚhandle)
Úselfr   r   r   r   r   r   r   r!   Úargss
             ú\/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/xgboost/federated.pyÚ__init__zFederatedTracker.__init__%   s]   € ô —‘Ó"ˆÜØØØ)Ø#Ø+Ø-Ø-Ü˜“Lô	
ˆô 	”D×(Ñ(¨¬v¯|©|¸FÓ/CÓDÔEØˆ�ó    )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   Úboolr   Ústrr%   © r&   r$   r   r      sƒ   „ ñð2  ð *.Ø*.Ø*.Øòàðð ðð
 ðð " #™ðð # 3™-ðð # 3™-ðð ðð 
òó  ñr&   r   Tr   )r   r   r   Úblockingr   r   r   r   r   r   r.   r   r   c          	      ó:  — d| i}t        d„ |||fD «       «      }t        | ||||||¬«      }	|	j                  «        |r|	j                  «        yt	        |	j                  ¬«      }
d|
_        |
j                  «        |j                  |	j                  «       «       |S )a|  See :py:class:`~xgboost.federated.FederatedTracker` for more info.

    Parameters
    ----------
    blocking :
        Block the server until the training is finished. If set to False, the function
        launches an additional thread and returns the worker arguments. The default is
        True and a higher level framework is responsible for setting worker parameters.

    r   c              3   ó$   K  — | ]  }|d u–— Œ
 y ­w)Nr-   )Ú.0Úpaths     r$   ú	<genexpr>z'run_federated_server.<locals>.<genexpr>V   s   è ø€ ò àð 	�DÔñùs   ‚)r   r   r   r   r   r   r   N)ÚtargetT)Úallr   ÚstartÚwait_forr   ÚdaemonÚupdateÚworker_args)r   r   r   r   r   r.   r   r#   r   ÚtrackerÚthreads              r$   Úrun_federated_serverr=   @   s¦   € ð* (¨Ð3€DÜñ à$Ð&6Ð8HÐIôó €Fô ØØØØØ'Ø)Ø)ô€Gð ‡M�M„OáØ×ÑÔØä˜7×+Ñ+Ô,€FØ€F„MØ
‡L�L„NØ‡K�K�×#Ñ#Ó%Ô&Ø€Kr&   )r*   r   Ú	threadingr   Útypingr   r   r   Úcorer   r	   r
   r   r;   r   r   r   r,   r+   r=   r-   r&   r$   ú<module>rA      s´   ðÙ :ã Ý ß &Ñ &ç LÓ LÝ !ô2�|ô 2ðj ð
 &*Ø&*Ø&*ØØò,Øð,à
ð,ð ˜c‘]ð	,ð
 ˜s‘mð,ð ˜s‘mð,ð ð,ð ð,ð ˆd�3˜�8‰nÑò,ó ñ,r&   