o
    $i                     @   s   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d	Z	dee deeeeef f fd
dZ
dS )    )AnyDictListN)	ObjectRefobj_refs
timeout_msreturnc                 C   s$   t  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    r   W/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/ray/experimental/locations.pyr      s
   r   c                 C   s&   t  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   r   r   r   r   -   s   
r   )r   )typingr   r   r   r   ray._rayletr   intstrr   r   r   r   r   r   <module>   s     
&