
    0Fie                    2    d dl mZ d dlmZ erd dlZd	dZdS )
    )annotations)TYPE_CHECKINGNanumpy.ndarrayreturn!numpy.ndarray | bytes | bytearrayc                &   ddl }t          | |j                  sJ | }	 t          |t                    r|j        }nVt          ||j                  r|j        |j        }n2|S t          |t          t          f          r|S t          d|          t)zGiven a numpy array, find the underlying memory allocated by either
    distributed.protocol.utils.host_array or internally by numpy
    r   NTzUnexpected numpy buffer: )	numpy
isinstancendarray
memoryviewobjbasebytes	bytearray	TypeError)r   r
   os      ?lib/python3.11/site-packages/distributed/protocol/utils_test.pyget_host_arrayr   	   s     LLLa'''''A?a$$ 
	?AA5=)) 	?v!FE9-.. 	?H===>>>?    )r   r   r   r   )
__future__r   typingr   r
   r    r   r   <module>r      sX    " " " " " "             LLL? ? ? ? ? ?r   