o
    2h                     @   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)NumpyRequiredForThisFeatureimport_numpy   c                 C   s   |  t||d S )z5Get decodes a value at buf[head] using `packer_type`.    )unpack_fromr   )packer_typebufhead r   M/var/www/html/chatgem/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)znGetVecAsNumpy decodes values starting at buf[head] as

  `numpy_type`, where `numpy_type` is a numpy dtype.
  N)dtypecountoffsetzNumpy was not found.)np
frombufferr   )
numpy_typer   r   r   r   r   r   GetVectorAsNumpy   s   r   c                 C   s   |  ||| dS )z3Write 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   FILE_IDENTIFIER_LENGTHr   r   r   r   r   r   r   <module>   s   