
    &`i                         d dl mZmZmZ d dlZd dlmZ 	 d
dee         dedeeeeef         f         fdZ	dee         deeeeef         f         fd	Z
dS )    )AnyDictListN)	ObjectRefobj_refs
timeout_msreturnc                     t          j                    st          d          t           j        j        j        j                            | |          S )ad  Lookup the locations for a list of objects.

    It returns a dict maps from an object to its location. The dict excludes
    those objects whose location lookup failed.

    Args:
        object_refs (List[ObjectRef]): List of object refs.
        timeout_ms: The maximum amount of time in micro seconds to wait
            before returning. Wait infinitely if it's negative.

    Returns:
        A dict maps from an object to its location. The dict excludes those
        objects whose location lookup failed.

        The location is stored as a dict with following attributes:

        - node_ids (List[str]): The hex IDs of the nodes that have a
          copy of this object. Objects less than 100KB will be in memory
          store not plasma store and therefore will have nodes_id = [].

        - object_size (int): The size of data + metadata in bytes. Can be None if the
          size is unknown yet (e.g. task not completed).

    Raises:
        RuntimeError: if the processes were not started by ray.init().
        ray.exceptions.GetTimeoutError: if it couldn't finish the
            request in time.
    Ray hasn't been initialized.)rayis_initializedRuntimeError_privateworkerglobal_workercore_workerget_object_locations)r   r	   s     n/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/experimental/locations.pyr   r      sL    >  ;9:::<,8MM*      c                     t          j                    st          d          t           j        j        j        j        }|                    |           S )a  Lookup the locations for a list of objects *from the local core worker*. No RPCs
    are made in this method.

    It returns a dict maps from an object to its location. The dict excludes
    those objects whose location lookup failed.

    Args:
        object_refs (List[ObjectRef]): List of object refs.

    Returns:
        A dict maps from an object to its location. The dict excludes those
        objects whose location lookup failed.

        The location is stored as a dict with following attributes:

        - node_ids (List[str]): The hex IDs of the nodes that have a
          copy of this object. Objects less than 100KB will be in memory
          store not plasma store and therefore will have nodes_id = [].

        - object_size (int): The size of data + metadata in bytes. Can be None if the
          size is unknown yet (e.g. task not completed).

    Raises:
        RuntimeError: if the processes were not started by ray.init().
    r   )r   r   r   r   r   r   r   get_local_object_locations)r   r   s     r   r   r   -   sH    8  ;9:::,%3?K11(;;;r   )r   )typingr   r   r   r   ray._rayletr   intstrr   r    r   r   <module>r      s    " " " " " " " " " " 



 ! ! ! ! ! ! 24# #9o#+.#	)T#s(^
#$# # # #L<9o<	)T#s(^
#$< < < < < <r   