a
    c	g                     @  s   U d dl mZ d dlZd dlZd dlZedZG dd deje ZG dd dee	 Z
G dd	 d	ee	 ZG d
d dee ZG dd dee ZG dd deej Ze
 e e e e dZded< ddddddZdS )    )annotationsNTc                   @  s:   e Zd ZU dZded< dddddZdddd	d
ZdS )	Convertor ztyping.ClassVar[str]regexstrr   valuereturnc                 C  s
   t  d S NNotImplementedErrorselfr	    r   W/var/www/html/llm_bihealth/app/venv/lib/python3.9/site-packages/starlette/convertors.pyconvert   s    zConvertor.convertc                 C  s
   t  d S r   r   r   r   r   r   	to_string   s    zConvertor.to_stringN)__name__
__module____qualname__r   __annotations__r   r   r   r   r   r   r   
   s   
r   c                   @  s0   e Zd ZdZdddddZdddddZdS )	StringConvertorz[^/]+r   r   c                 C  s   |S r   r   r   r   r   r   r      s    zStringConvertor.convertc                 C  s(   t |}d|vsJ d|s$J d|S )N/zMay not contain path separatorszMust not be emptyr   r   r   r   r   r      s    zStringConvertor.to_stringNr   r   r   r   r   r   r   r   r   r   r      s   r   c                   @  s0   e Zd ZdZdddddZdddddZdS )	PathConvertorz.*r   r   c                 C  s   t |S r   r   r   r   r   r   r   $   s    zPathConvertor.convertc                 C  s   t |S r   r   r   r   r   r   r   '   s    zPathConvertor.to_stringNr   r   r   r   r   r   !   s   r   c                   @  s0   e Zd ZdZdddddZdddddZd	S )
IntegerConvertorz[0-9]+r   intr   c                 C  s   t |S r   )r   r   r   r   r   r   .   s    zIntegerConvertor.convertc                 C  s    t |}|dksJ dt|S )Nr   z#Negative integers are not supported)r   r   r   r   r   r   r   1   s    zIntegerConvertor.to_stringNr   r   r   r   r   r   +   s   r   c                   @  s0   e Zd ZdZdddddZdddddZd	S )
FloatConvertorz[0-9]+(\.[0-9]+)?r   floatr   c                 C  s   t |S r   )r    r   r   r   r   r   :   s    zFloatConvertor.convertc                 C  sP   t |}|dksJ dt|r*J dt|r<J dd| ddS )Ng        z!Negative floats are not supportedzNaN values are not supportedz!Infinite values are not supportedz%0.20f0.)r    mathisnanisinfrstripr   r   r   r   r   =   s
    zFloatConvertor.to_stringNr   r   r   r   r   r   7   s   r   c                   @  s0   e Zd ZdZdddddZdddddZd	S )
UUIDConvertorz<[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}r   z	uuid.UUIDr   c                 C  s
   t |S r   )uuidUUIDr   r   r   r   r   H   s    zUUIDConvertor.convertc                 C  s   t |S r   r   r   r   r   r   r   K   s    zUUIDConvertor.to_stringNr   r   r   r   r   r'   E   s   r'   )r   pathr   r    r(   z dict[str, Convertor[typing.Any]]CONVERTOR_TYPESr   zConvertor[typing.Any]None)key	convertorr
   c                 C  s   |t | < d S r   )r+   )r-   r.   r   r   r   register_url_convertorX   s    r/   )
__future__r   r#   typingr(   TypeVarr   Genericr   r   r   r   r   r   r    r   r)   r'   r+   r   r/   r   r   r   r   <module>   s"   


	