HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/aiohttp/__pycache__/web.cpython-310.pyc
o

���g�G�'@sTddlZddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZmZmZmZm	ZmZmZmZmZmZmZddlmZdd	lmZdd
lmZddl m!Z!ddl"m#Z#m$Z$dd
l%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\m]Z]m^Z^m_Z_m`Z`ddlambZbddlcmdZdddlemfZfmgZgddlhmiZimjZjmkZkddllmmZmmnZnmoZoddlpmqZqmrZrmsZsmtZtddlumvZvmwZwmxZxmyZymzZzm{Z{m|Z|m}Z}m~Z~mZm�Z�m�Z�m�Z�m�Z�ddl�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�ddl�m�Z�ddl�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�ddl�m�Z�m�Z�m�Z�dZ�e�r�ddl�m�Z�nzddl�m�Z�Wne��y�e�Z�Ynwej�de`dd�ee�Z�ddddddde�d ededj�edddd!d"�d#ee#ee#fd$eee�e�fd%ee�d&ee!ee!dfd'eeejeejfd(e�d)e�d*ee�d+eed,d-e�d.eed/e�d0eej�d1e�d2ee�d3ee�d4e�d5df$d6d7�Z�d8ed9d:ej�d5dfd;d<�Z�ddddddde�d ededj�edddd!dd=�d#ee#ee#fd$eee�e�fd%ee�d&ee!ee!dfd'eeejeejfd(e�d)e�d*ee�d+eed,d-e�d.eed/e�d0eej�d1e�d2ee�d3ee�d4e�d:eej�d5df&d>d?�Z�d@ee�d5dfdAdB�Z�e�dCk�r�e�ej�dd��dSdS)D�N)�ArgumentParser)�Iterable)�suppress)�
import_module)�
TYPE_CHECKING�Any�	Awaitable�Callabler�List�Optional�Set�Type�Union�cast�)�AbstractAccessLogger)�AppKey)�
access_logger)�PathLike)�Application�CleanupError);�HTTPAccepted�HTTPBadGateway�HTTPBadRequest�HTTPClientError�HTTPConflict�HTTPCreated�	HTTPError�
HTTPException�HTTPExpectationFailed�HTTPFailedDependency�
HTTPForbidden�	HTTPFound�HTTPGatewayTimeout�HTTPGone�HTTPInsufficientStorage�HTTPInternalServerError�HTTPLengthRequired�HTTPMethodNotAllowed�HTTPMisdirectedRequest�HTTPMove�HTTPMovedPermanently�HTTPMultipleChoices�!HTTPNetworkAuthenticationRequired�
HTTPNoContent�HTTPNonAuthoritativeInformation�HTTPNotAcceptable�HTTPNotExtended�HTTPNotFound�HTTPNotImplemented�HTTPNotModified�HTTPOk�HTTPPartialContent�HTTPPaymentRequired�HTTPPermanentRedirect�HTTPPreconditionFailed�HTTPPreconditionRequired�HTTPProxyAuthenticationRequired�HTTPRedirection�HTTPRequestEntityTooLarge�HTTPRequestHeaderFieldsTooLarge�HTTPRequestRangeNotSatisfiable�HTTPRequestTimeout�HTTPRequestURITooLong�HTTPResetContent�HTTPSeeOther�HTTPServerError�HTTPServiceUnavailable�HTTPSuccessful�HTTPTemporaryRedirect�HTTPTooManyRequests�HTTPUnauthorized�HTTPUnavailableForLegalReasons�HTTPUnprocessableEntity�HTTPUnsupportedMediaType�HTTPUpgradeRequired�HTTPUseProxy�HTTPVariantAlsoNegotiates�HTTPVersionNotSupported�NotAppKeyWarning)�FileResponse)�AccessLogger)�
middleware�normalize_path_middleware)�PayloadAccessError�RequestHandler�RequestPayloadError)�BaseRequest�	FileField�Request)�
ContentCoding�Response�StreamResponse�
json_response)�AbstractRouteDef�RouteDef�
RouteTableDef�	StaticDef�delete�get�head�options�patch�post�put�route�static�view)	�	AppRunner�
BaseRunner�BaseSite�GracefulExit�
NamedPipeSite�ServerRunner�SockSite�TCPSite�UnixSite)�Server)�AbstractResource�
AbstractRoute�DynamicResource�
PlainResource�PrefixedSubAppResource�Resource�
ResourceRoute�StaticResource�
UrlDispatcher�UrlMappingMatchInfo�View)�WebSocketReady�WebSocketResponse�	WSMsgType)rrrrrQrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrRrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrsrtrurvrrrwrxryrzr{r|r}r~rr�r�r�r�r�r��run_app)�
SSLContext�ignoreT)�category�appendgN@g�R@�F)�host�port�path�sock�shutdown_timeout�keepalive_timeout�ssl_context�print�backlog�access_log_class�access_log_format�
access_log�handle_signals�
reuse_address�
reuse_port�handler_cancellation�appr�r�r�r�r�r�r�r�).Nr�r�r�r�r�r�r�r��returnc�s��t�|�r|IdH}tt|�}t||
|
|||||d�}|��IdHg}z�|durVt|ttt	t
f�rB|�t|||||	||d��n-|D]}|�t|||||	||d��qDn|dur^|dusb|duro|�t||||	||d��|dur�t|tt
jf�r�|�t||||	d��n|D]
}|�t||||	d��q�|dur�t|t�s�|�t||||	d��n|D]
}|�t||||	d��q�|D]	}|��IdHq�|r�tdd�|jD��}|d�d�|���	t�d
�IdHq�|��IdHw)N)r�r�r�r�r�r�r�)r�r�r�r�)r�r�r�r�r�)r�r�css�|]}t|j�VqdS)N)�str�name)�.0�s�r��6/usr/local/lib/python3.10/dist-packages/aiohttp/web.py�	<genexpr>�s�z_run_app.<locals>.<genexpr>z6======== Running on {} ========
(Press CTRL+C to quit)z, Ti)�asyncio�iscoroutinerrrn�setup�
isinstancer��bytes�	bytearray�
memoryviewr�ru�osrrvrrt�start�sorted�sites�format�join�sleep�cleanup)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��runnerr��h�pr��site�namesr�r�r��_run_app1s��


����������	��	
��	����r��	to_cancelzasyncio.Task[Any]�loopcCsj|sdS|D]}|��q|�tj|ddi��|D]}|��r!q|��dur2|�d|��|d��qdS)N�return_exceptionsTz1unhandled exception during asyncio.run() shutdown)�message�	exception�task)�cancel�run_until_completer��gather�	cancelledr��call_exception_handler)r�r�r�r�r�r��
_cancel_tasks�s"
����r�)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�cCsr|durt��}|��r*|r*|jdkr*|jtjkr|�tj�|�	�s*|�
t���|�t
|fid|�d|�d|�d|�d|�d|�d	|�d
|�d|	�d|
�d
|�d|�d|
�d|�d|�d|���}zxzt�|�|�|�Wnttfy{YnwWzJ|��ttj��
|�|�Wd�n1s�wYWtt�|�|�|�|���|��dSWtt�|�|�|�|���|��dStt�|�|�|�|���|��wzH|��ttj��
|�|�Wd�n1s�wYWtt�|�|�|�|���|��wWtt�|�|�|�|���|��wtt�|�|�|�|���|��w)zRun an app locallyNzaiohttp.accessr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�)r��new_event_loop�	get_debugr��level�logging�NOTSET�setLevel�DEBUG�hasHandlers�
addHandler�
StreamHandler�create_taskr��set_event_loopr�rq�KeyboardInterruptr�r�CancelledErrorr��	all_tasks�shutdown_asyncgens�close)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��	main_taskr�r�r�r��s���������	�
���
������
�����
��
�
�
r��argvc

Cs�tddd�}|jdddd�|jdd	d
dd�|jdd
dtdd�|jdddd�|�|�\}}|j�d�\}}}|r=|sB|�d�|�d�rL|�d�zt|�}Wnt	yo}z|�d|�d|���WYd}~nd}~wwzt
||�}	Wnty�|�d|�d|���Ynw|jdur�t
td�s�|�d�tjtjd�|jr�|jdur�d}
}n|jp�d }
|j}|	|�}t||
||jd!�|jd"d#�dS)$Nzaiohttp.web Application serverzaiohttp.web)�description�prog�
entry_funczvCallable returning the `aiohttp.web.Application` instance to run. Should be specified in the 'module:function' syntax.z
entry-func)�help�metavarz-Hz
--hostnamez0TCP/IP hostname to serve on (default: localhost))r��defaultz-Pz--portz.TCP/IP port to serve on (default: %(default)r)i�)r��typer�z-Uz--pathz_Unix file system path to serve on. Can be combined with hostname to serve on both Unix and TCP.)r��:z,'entry-func' not in 'module:function' syntax�.z#relative module names not supportedzunable to import z: zmodule z has no attribute �AF_UNIXz=file system paths not supported by your operating environment)r��	localhost)r�r�r�zStopped
)r�)r�add_argument�int�parse_known_argsr��	partition�error�
startswithr�ImportError�getattr�AttributeErrorr��hasattr�socketr��basicConfigr��hostnamer�r��exit)
r��
arg_parser�args�
extra_argv�mod_str�_�func_str�module�ex�funcr�r�r�r�r�r��mainsn�����


"����

r��__main__)�r�r�r�r��sys�warnings�argparser�collections.abcr�
contextlibr�	importlibr�typingrrrr	�TypingIterabler
rrr
rr�abcr�helpersr�logr�typedefsr�web_apprr�web_exceptionsrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQ�web_fileresponserR�web_logrS�web_middlewaresrTrU�web_protocolrVrWrX�web_requestrYrZr[�web_responser\r]r^r_�web_routedefr`rarbrcrdrerfrgrhrirjrkrlrm�
web_runnerrnrorprqrrrsrtrurv�
web_serverrw�web_urldispatcherrxryrzr{r|r}r~rr�r�r��web_wsr�r�r��__all__�sslr�r��object�filterwarningsr��HostSequencer��
LOG_FORMATr��float�Logger�boolr��AbstractEventLoopr�r�r��__name__r�r�r�r�r��<module>s@4�=@,4
���������	�

���
������
���
���������	�

���
�������
�F
C�