HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberPanel/lib64/python3.10/site-packages/fastapi/__pycache__/utils.cpython-310.pyc
o

�h�@s<UddlZddlZddlmZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
ddlmZddlZddlmZmZmZmZmZmZmZmZddlmZmZddlmZmZddl m!Z!dd	l"m#Z#ergd
dl$m%Z%e�Z&eeeeefe'd<d
ee(e)dfde*fdd�Z+de)de
e)fdd�Z,deeedddfde)dede	ee)efde	edee*efdeede	e!de	e)de#ddefdd �Z-dd!�d"ed#e	eeeeefdefd$d%�Z.de)de)d&e)de)fd'd(�Z/d)d*de)fd+d,�Z0d-eeefd.eeefddfd/d0�Z1d1eeefd2eeefdeeeffd3d4�Z2dS)5�N)�is_dataclass)	�
TYPE_CHECKING�Any�Dict�MutableMapping�Optional�Set�Type�Union�cast)�WeakKeyDictionary)�PYDANTIC_V2�
BaseConfig�
ModelField�PydanticSchemaGenerationError�	Undefined�
UndefinedType�	Validator�lenient_issubclass)�DefaultPlaceholder�DefaultType)�	BaseModel�create_model)�	FieldInfo)�Literal�)�APIRoute�_CLONED_TYPES_CACHE�status_code�returncCs2|durdS|dvrdSt|�}|dkp|dvS)NT>�1XX�2XX�3XX�4XX�5XX�default��>�0����)�int)r�current_status_code�r,�C/usr/local/CyberPanel/lib/python3.10/site-packages/fastapi/utils.py�is_body_allowed_for_status_code*sr.�pathcCstt�d|��S)Nz{(.*?)})�set�re�findall)r/r,r,r-�get_path_param_names;sr3�
validation�name�type_�class_validatorsr%�required�model_config�
field_info�alias�mode)r4�
serializationc	
	Cs�|pi}tr|pt|||d�}n|pt�}||d�}	tr$|	�d|i�n|	�||||||d��ztdi|	��WSttfyLtj�d|�d��d�w)N)�
annotationr%r;)r5r:r<)r6r7r%r8r9r;z2Invalid args for response field! Hint: check that aY is a valid Pydantic field type. If you are using a return type annotation that is not a valid Pydantic field (e.g. Union[Response, dict, None]) you can disable generating the response model from the type annotation with the path operation decorator parameter response_model=None. Read more: https://fastapi.tiangolo.com/tutorial/response-model/r,)	r
r�updater�RuntimeErrorr�fastapi�
exceptions�FastAPIError)
r5r6r7r%r8r9r:r;r<�kwargsr,r,r-�create_model_field?s:�

��
����rE��cloned_types�fieldrGcsVtr|S�dur
t�|j}t|�rt|d�r|j}|}t|t�rMtt	t|�}��
|�}|durMt|j|d�}|�|<|j
��D]}t|�d�|j
|j<q@t|j|d�}|j|_|j|_|j|_|j|_|j|_|j|_|j|_|j|_|j|_|jr��fdd�|jD�|_|jr�t|j�d�|_|j|_|j|_|j|_|j |_ |j!|_!|�"�|S)N�__pydantic_model__)�__base__rF)r5r6csg|]}t|�d��qS)rF)�create_cloned_field)�.0�	sub_fieldrFr,r-�
<listcomp>�s
��z'create_cloned_field.<locals>.<listcomp>)#r
rr6r�hasattrrIrrrr	�getr�__name__�
__fields__�valuesrKr5rE�	has_aliasr;r7r%r8r9r:�
allow_none�validate_always�
sub_fields�	key_field�
validators�pre_validators�post_validators�
parse_json�shape�populate_validators)rHrG�
original_type�use_type�f�	new_fieldr,rFr-rKmsX

�
��rK�methodcCs@tjdtdd�|�|��}t�dd|�}|�d|����}|S)Nzrfastapi.utils.generate_operation_id_for_path() was deprecated, it is not used internally, and will be removed soon�)�
stacklevel�\W�_)�warnings�warn�DeprecationWarningr1�sub�lower)r5r/rc�operation_idr,r,r-�generate_operation_id_for_path�s�rn�routercCsH|j�|j��}t�dd|�}|jsJ�|�dt|j�d����}|S)Nrfrgr)r5�path_formatr1rk�methods�listrl)rormr,r,r-�generate_unique_id�s

rs�	main_dict�update_dictcCs�|��D]=\}}||vr t||t�r t|t�r t|||�q||vr=t||t�r=t||t�r=||||||<q|||<qdS)N)�items�
isinstance�dict�deep_dict_updaterr)rtru�key�valuer,r,r-ry�s����
�ry�
first_item�extra_itemscGs*|f|}|D]}t|t�s|Sq|S)z�
    Pass items or `DefaultPlaceholder`s by descending priority.

    The first one to _not_ be a `DefaultPlaceholder` will be returned.

    Otherwise, the first item (a `DefaultPlaceholder`) will be returned.
    )rwr)r|r}rv�itemr,r,r-�get_value_or_default�s

�r)3r1rh�dataclassesr�typingrrrrrrr	r
r�weakrefrrA�fastapi._compatr
rrrrrrr�fastapi.datastructuresrr�pydanticrr�pydantic.fieldsr�typing_extensionsr�routingrr�__annotations__r*�str�boolr.r3rErKrnrsryrr,r,r,r-�<module>s�
,(
������
����	�

�1���
�7���
�&
�
�
�