o
    ¦ƒðj  ã                   @   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   ú”/tmp/claude-1000/-var-www-html-academy/3f42efd1-c2b7-4d08-9b05-30d86bb35479/scratchpad/piper/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   