
    &`iz
              
          d dl mZmZmZ d dlZdedee         fdZ	 d
dedeeej        j        ej	        j
        f                  deeej        j        ej	        j
        f         ef         fdZ	 d
deeej        j        ej	        j
        f                  deeej        j        ej	        j
        f         ef         fd	ZdS )    )DictOptionalUnionNnode_ipreturnc                 n    t          j                    D ] }|d         r|d         | k    r
|d         c S !dS )z?Returns the node ID for the first alive node with the input IP.AliveNodeManagerAddressNodeIDN)raynodes)r   nodes     e/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/air/util/node.py_get_node_id_from_node_ipr      sI    	 " "= 	"T"677BB>!!!4    node_idremote_func_or_actor_classc                 x    t           j        j                            | d          }d|i}||S  |j        di |S )a  Schedule a remote function or actor class on a given node.

    Args:
        node_id: The node to schedule on.
        remote_func_or_actor_class: A Ray remote function or actor class
            to schedule on the input node. If None, this function will directly
            return the options dict to pass to another remote function or actor class
            as remote options.
    Returns:
        The provided remote function or actor class, but with options modified to force
        placement on the input node. If remote_func_or_actor_class is None,
        the options dict to pass to another remote function or
        actor class as remote options kwargs.
    F)r   softscheduling_strategyN )r   utilscheduling_strategiesNodeAffinitySchedulingStrategyoptions)r   r   r   r   s       r   _force_on_noder      s\    * (8WWe X   %&9:G!)-%-88888r   c                 l    t          j                                                    }t          ||           S )a  Schedule a remote function or actor class on the current node.

    If using Ray Client, the current node is the client server node.

    Args:
        remote_func_or_actor_class: A Ray remote function or actor class
            to schedule on the current node. If None, this function will directly
            return the options dict to pass to another remote function or actor class
            as remote options.
    Returns:
        The provided remote function or actor class, but with options modified to force
        placement on the current node. If remote_func_or_actor_class is None,
        the options dict to pass to another remote function or
        actor class as remote options kwargs.
    )r   get_runtime_contextget_node_idr   )r   current_node_ids     r   _force_on_current_noder!   0   s/    ( -//;;==O/+EFFFr   )N)typingr   r   r   r   strr   remote_functionRemoteFunctionactor
ActorClassr   r!   r   r   r   <module>r(      sF   ( ( ( ( ( ( ( ( ( ( 



s x}     		9 99 (c!0#)2FFG!9
 5$3SY5IIJDPQ9 9 9 9H 	G G (c!0#)2FFG!G 5$3SY5IIJDPQ	G G G G G Gr   