B
    d-                 @   sZ   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Z	dd Z
dd	 Zd
d ZdS )   )number_types)packer)memoryview_type)import_numpyNumpyRequiredForThisFeature   c             C   s   |  t||d S )z7 Get decodes a value at buf[head] using `packer_type`.     )unpack_fromr   )packer_typebufhead r   D/var/www/html/venv/lib/python3.7/site-packages/flatbuffers/encode.pyGet   s    r   c             C   s&   t dk	rt j|| ||dS tddS )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   ZFILE_IDENTIFIER_LENGTHr   r   r   r   r   r   r   <module>   s   