§
    &`ƒi/  ã                   ó&  — U d dl Z d dlmZmZmZ d dlmZ d dlmZm	Z	 d dl
mZ d dlmZ d dlmZ d dlmZmZ daed	         ed
<    e j        ¦   «         Zde› Z ed¬¦  «         G d„ d	e¦  «        ¦   «         Z ed¬¦  «        defd„¦   «         ZdS )é    N)ÚAnyÚDictÚOptional)Úsession)ÚV2_MIGRATION_GUIDE_MESSAGEÚ_v2_migration_warnings_enabled)ÚTrainContext)Ú	_copy_doc)ÚPlacementGroupFactory)Ú
DeprecatedÚ	PublicAPIÚTuneContextÚ_tune_contextz¨`{}` is deprecated for Ray Tune because there is no concept of worker ranks for Ray Tune, so these methods only make sense to use in the context of a Ray Train worker. Úbeta)Ú	stabilityc                   ó  — e Zd ZdZ eej        ¦  «        defd„¦   «         Z eej        ¦  «        defd„¦   «         Z eej	        ¦  «        de
fd„¦   «         Z	 eej        ¦  «        defd„¦   «         Zedeeef         fd„¦   «         Z ee                     d¦  «         e¦   «         ¬	¦  «         eej        ¦  «        defd
„¦   «         ¦   «         Z ee                     d¦  «         e¦   «         ¬	¦  «         eej        ¦  «        defd„¦   «         ¦   «         Z ee                     d¦  «         e¦   «         ¬	¦  «         eej        ¦  «        defd„¦   «         ¦   «         Z ee                     d¦  «         e¦   «         ¬	¦  «         eej        ¦  «        defd„¦   «         ¦   «         Z ee                     d¦  «         e¦   «         ¬	¦  «         eej        ¦  «        defd„¦   «         ¦   «         ZdS )r   z5Context to access metadata within Ray Tune functions.Úreturnc                 ó(   — t          j        ¦   «         S ©N)r   Úget_trial_name©Úselfs    úd/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/tune/context.pyr   zTuneContext.get_trial_name"   s   € åÔ%Ñ'Ô'Ð'ó    c                 ó(   — t          j        ¦   «         S r   )r   Úget_trial_idr   s    r   r   zTuneContext.get_trial_id&   s   € åÔ#Ñ%Ô%Ð%r   c                 ó(   — t          j        ¦   «         S r   )r   Úget_trial_resourcesr   s    r   r   zTuneContext.get_trial_resources*   s   € åÔ*Ñ,Ô,Ð,r   c                 ó(   — t          j        ¦   «         S r   )r   Úget_trial_dirr   s    r   r    zTuneContext.get_trial_dir.   s   € åÔ$Ñ&Ô&Ð&r   c                 ó    — t          d¦  «        ‚)NzG`get_metadata` is deprecated for Ray Tune, as it has never been usable.)ÚDeprecationWarningr   s    r   Úget_metadatazTuneContext.get_metadata4   s   € å ØUñ
ô 
ð 	
r   Úget_world_size)ÚmessageÚwarningc                 ó(   — t          j        ¦   «         S r   )r   r$   r   s    r   r$   zTuneContext.get_world_size:   ó   € õ Ô%Ñ'Ô'Ð'r   Úget_world_rankc                 ó(   — t          j        ¦   «         S r   )r   r)   r   s    r   r)   zTuneContext.get_world_rankB   r(   r   Úget_local_rankc                 ó(   — t          j        ¦   «         S r   )r   r+   r   s    r   r+   zTuneContext.get_local_rankJ   r(   r   Úget_local_world_sizec                 ó(   — t          j        ¦   «         S r   )r   r-   r   s    r   r-   z TuneContext.get_local_world_sizeR   s   € õ Ô+Ñ-Ô-Ð-r   Úget_node_rankc                 ó(   — t          j        ¦   «         S r   )r   r/   r   s    r   r/   zTuneContext.get_node_rank\   s   € õ Ô$Ñ&Ô&Ð&r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   r   Ústrr   r   r   r    r   r   r   r#   Ú+_TRAIN_SPECIFIC_CONTEXT_DEPRECATION_MESSAGEÚformatr   ÚTrainV1Contextr$   Úintr)   r+   r-   r/   © r   r   r   r      sb  € € € € € à?Ð?ð €YˆwÔ%Ñ&Ô&ð( ð (ð (ð (ñ 'Ô&ð(ð €YˆwÔ#Ñ$Ô$ð&˜cð &ð &ð &ñ %Ô$ð&ð €YˆwÔ*Ñ+Ô+ð-Ð%:ð -ð -ð -ñ ,Ô+ð-ð €YˆwÔ$Ñ%Ô%ð'˜sð 'ð 'ð 'ñ &Ô%ð'ð
 ð
˜d 3¨ 8œnð 
ð 
ð 
ñ „Zð
ð
 €ZØ;×BÒBÐCSÑTÔTØ.Ð.Ñ0Ô0ðñ ô ð €Yˆ~Ô,Ñ-Ô-ð( ð (ð (ð (ñ .Ô-ñ	ô ð
(ð €ZØ;×BÒBÐCSÑTÔTØ.Ð.Ñ0Ô0ðñ ô ð €Yˆ~Ô,Ñ-Ô-ð( ð (ð (ð (ñ .Ô-ñ	ô ð
(ð €ZØ;×BÒBÐCSÑTÔTØ.Ð.Ñ0Ô0ðñ ô ð €Yˆ~Ô,Ñ-Ô-ð( ð (ð (ð (ñ .Ô-ñ	ô ð
(ð €ZØ;×BÒBØ"ñ
ô 
ð /Ð.Ñ0Ô0ð	ñ ô ð €Yˆ~Ô2Ñ3Ô3ð. cð .ð .ð .ñ 4Ô3ñô ð.ð €ZØ;×BÒBÀ?ÑSÔSØ.Ð.Ñ0Ô0ðñ ô ð €Yˆ~Ô+Ñ,Ô,ð'˜sð 'ð 'ð 'ñ -Ô,ñ	ô ð
'ð 'ð 'r   r   c                  ó|   — t           5  t          €t          ¦   «         at          cddd¦  «         S # 1 swxY w Y   dS )zÚGet or create a singleton Ray Tune context.

    The context is only available in a tune function passed to the `ray.tune.Tuner`.

    See the :class:`~ray.tune.TuneContext` API reference to see available methods.
    N)Ú_tune_context_lockr   r   r:   r   r   Úget_contextr=   e   s‚   € õ 
ð ð ÝÐ õ (™MœMˆMÝðð ð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð ð s   ˆ1±5¸5)Ú	threadingÚtypingr   r   r   Úray.train._internalr   Úray.train.constantsr   r   Úray.train.contextr	   r8   Úray.train.utilsr
   Ú#ray.tune.execution.placement_groupsr   Úray.util.annotationsr   r   r   Ú__annotations__ÚLockr<   r6   r   r=   r:   r   r   ú<module>rH      s†  ðØ Ð Ð Ð Ð Ø &Ð &Ð &Ð &Ð &Ð &Ð &Ð &Ð &Ð &à 'Ð 'Ð 'Ð 'Ð 'Ð 'ðð ð ð ð ð ð ð ð =Ð <Ð <Ð <Ð <Ð <Ø %Ð %Ð %Ð %Ð %Ð %Ø EÐ EÐ EÐ EÐ EÐ EØ 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6ð *.€ˆx˜Ô&Ð -Ð -Ñ -Ø#Y”^Ñ%Ô%Ð ð8à5ð8ð 8ð ,ð €VÐÑÔðG'ð G'ð G'ð G'ð G'.ñ G'ô G'ñ ÔðG'ðT €VÐÑÔð[ð ð ð ñ Ôðð ð r   