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: //home/arjun/projects/env/lib/python3.10/site-packages/aiohttp/__pycache__/web.cpython-310.pyc
o

+we?K�'@sTddlZddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZmZmZm	ZmZmZmZmZmZmZddlmZd	d
lmZd	dlm Z d	dl!m"Z"d	d
l#m$Z$d	dl%m&Z&m'Z'd	dl(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`maZambZbmcZcd	dldmeZed	dlfmgZgd	dlhmiZimjZjd	dlkmlZlmmZmmnZnd	dlompZpmqZqmrZrd	dlsmtZtmuZumvZvmwZwd	dlxmyZymzZzm{Z{m|Z|m}Z}m~Z~mZm�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�d	dl�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�d	dl�m�Z�d	dl�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�d	dl�m�Z�m�Z�m�Z�dZ�zddl�m�Z�Wne��y�eZ�Ynwej�decdd�ee�Z�ddddd d!de�d"egegj�e"dddd#d$�d%ee&ee&fd&eee�e�fd'ee�d(ee$ee$dfd)eeejeejfd*e�d+e�d,ee�d-eed.d/e�d0eed1e�d2eej�d3e�d4ee�d5ee�d6e�d7df$d8d9�Z�d:ed;d<ej�d7dfd=d>�Z�ddddd d!de�d"egegj�e"dddd#dd?�d%ee&ee&fd&eee�e�fd'ee�d(ee$ee$dfd)eeejeejfd*e�d+e�d,ee�d-eed.d/e�d0eed1e�d2eej�d3e�d4ee�d5ee�d6e�d<eej�d7df&d@dA�Z�dBee�d7dfdCdD�Z�e�dEk�r�e�ej�d	d��dSdS)F�N)�ArgumentParser)�Iterable)�suppress)�partial)�
import_module)
�Any�	Awaitable�Callabler�List�Optional�Set�Type�Union�cast)�WeakSet�)�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)rrrrrRrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrSrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrtrurvrwrsrxryrzr{r|r}r~rr�r�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�dddtddf�fdd�}ddd	��t�|�r|IdH}tt|�}t||
|
|||||d
�}|��IdHtt���}t	|||�|_
g}z�|durut|tt
ttf�ra|�t|||||	||d��n-|D]}|�t|||||	||d��qcn|dur}|dus�|dur�|�t||||	||d��|dur�t|ttjf�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�starting_tasks�WeakSet[asyncio.Task[object]]r�r�c�sh�t��}|dusJ�|�|�ttj��tj�|�|d�IdHWd�dS1s-wYdS)N)�timeout)�asyncio�current_task�addr�TimeoutError�wait_for)r�r��t��_wait��D/home/arjun/projects/env/lib/python3.10/site-packages/aiohttp/web.py�waitCs�
"�z_run_app.<locals>.wait�excludec�s\�t��}|dusJ�|�|�t���|�}r,t�|�IdHt���|�}sdSdS�N)r�r�r��	all_tasks�
differencer�)r�r��tasksr�r�r�r�Ms�
�z_run_app.<locals>._wait)r�r�r�r�r�r�r�)r�r�r�r�)r�r�r�r�r�)r�r�css�|]}t|j�VqdSr�)�str�name)�.0�sr�r�r��	<genexpr>�s�z_run_app.<locals>.<genexpr>z6======== Running on {} ========
(Press CTRL+C to quit)z, Ti)r�r�r�N)�floatr��iscoroutinerrro�setuprr�r�shutdown_callback�
isinstancer��bytes�	bytearray�
memoryviewr�rv�osrrwrru�start�sorted�sites�format�join�sleep�cleanup)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��runnerr�r��h�pr��site�namesr�r�r��_run_app/s�����




����������	��	
��	����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�c
Cs�|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|���}zPzt�|�|�|�Wnttfy{YnwWt|h|�tt�|�|�|�|���|��dSWt|h|�tt�|�|�|�|���|��dSt|h|�tt�|�|�|�|���|��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�rr�KeyboardInterruptr�r��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
Csrtddd�}|jdddd�|jdd	d
dd�|jd
ddtdd�|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 �|	|�}
t|
|j|j|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
--hostnamez2TCP/IP hostname to serve on (default: %(default)r)�	localhost)r��defaultz-Pz--portz.TCP/IP port to serve on (default: %(default)r)�8080)r��typer�z-Uz--pathzjUnix file system path to serve on. Specifying a path will cause hostname and port arguments to be ignored.)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�)r�r�r�zStopped
)r�)r�add_argument�int�parse_known_argsr��	partition�error�
startswithr�ImportError�getattr�AttributeErrorr��hasattr�socketr��basicConfigr�r��hostnamer��exit)r��
arg_parser�args�
extra_argv�mod_str�_�func_str�module�ex�funcr�r�r�r��main*sf�����


"����r
�__main__)�r�r�r�r�sys�warnings�argparser�collections.abcr�
contextlibr�	functoolsr�	importlibr�typingrrr	�TypingIterabler
rrr
rr�weakrefr�abcr�helpersr�logr�typedefsr�web_apprr�web_exceptionsrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrR�web_fileresponserS�web_logrT�web_middlewaresrUrV�web_protocolrWrXrY�web_requestrZr[r\�web_responser]r^r_r`�web_routedefrarbrcrdrerfrgrhrirjrkrlrmrn�
web_runnerrorprqrrrsrtrurvrw�
web_serverrx�web_urldispatcherryrzr{r|r}r~rr�r�r�r��web_wsr�r�r��__all__�sslr�r��filterwarningsr��HostSequencer��
LOG_FORMATr�r��Logger�boolr��AbstractEventLoopr�r�r
�__name__r�r�r�r�r��<module>s@0�=@,4
���������	�

���
������
�"��
���������	�

���
�������
�B
=�