o
    i                     @   sV   d dl mZ d dl mZ d dlmZ d dlmZmZ e Zdd Z	dd Z
d	d
 ZdS )   )number_types)packer)memoryview_type)import_numpyNumpyRequiredForThisFeaturec                 C   s   |  t||d S )z7 Get decodes a value at buf[head] using `packer_type`.     )unpack_fromr   )packer_typebufhead r   L/home/kim/smarthome/.venv/lib/python3.10/site-packages/flatbuffers/encode.pyGet   s   r   c                 C   s"   t durt j|| ||dS td)zn GetVecAsNumpy decodes values starting at buf[head] as
    `numpy_type`, where `numpy_type` is a numpy dtype. N)ZdtypecountoffsetzNumpy was not found.)npZ
frombufferr   )Z
numpy_typer
   r   r   r   r   r   GetVectorAsNumpy   s   r   c                 C   s   |  ||| dS )z5 Write encodes `n` at buf[head] using `packer_type`. N)	pack_into)r	   r
   r   nr   r   r   Write&   s   r   N) r   Nr   compatr   r   r   r   r   r   r   r   r   r   r   <module>   s   