o
    Ú­já  ã                   @   s   d Z ddlZdefdd„ZdS )z$Collective module related utilities.é    NÚreturnc                  C   sL   t   t jt j¡�} |  d¡ |  ¡ d }W d  ƒ |S 1 sw   Y  |S )zÚReturns a port that's available during the function call. It doesn't prevent the
    port from being used after the function returns as we can't reserve the port. The
    utility makes a test more likely to pass.

    )z	127.0.0.1r   é   N)ÚsocketÚAF_INETÚSOCK_STREAMÚbindÚgetsockname)ÚserverÚport© r   úW/var/www/html/CropPilot/venv/lib/python3.10/site-packages/xgboost/testing/collective.pyÚget_avail_port   s   

þýr   )Ú__doc__r   Úintr   r   r   r   r   Ú<module>   s    