o
    NK&h                     @   s@  U d Z ddlZddlmZ ddlmZ ddlmZ zddlm	Z
 ee
ddZW n ey<   ddlm	Z	 ee	d	d
ZY nw i dddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,i d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNi dOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydz	Zeeef ed{< eg d|Zeg d}Zd~d Zdd Zdd ZdddZdefddZG dd dZe ZdS )z Defines basics of HTTP standard.    N)partial)import_module)ismodule)dumpsF)escape_forward_slashes),:)
separatorsd   s   Continuee   s   Switching Protocolsf   s
   Processingg   s   Early Hints   s   OK   s   Created   s   Accepted   s   Non-Authoritative Information   s
   No Content   s   Reset Content   s   Partial Content   s   Multi-Status   s   Already Reported   s   IM Usedi,  s   Multiple Choicesi-  s   Moved Permanentlyi.  s   Foundi/  s	   See Other0  s   Not Modifiedi1  s	   Use Proxyi3  s   Temporary Redirecti4  s   Permanent Redirecti  s   Bad Requesti  s   Unauthorizedi  s   Payment Requiredi  s	   Forbiddeni  s	   Not Foundi  s   Method Not Allowedi  s   Not Acceptablei  s   Proxy Authentication Requiredi  s   Request Timeouti  s   Conflicti  s   Gonei  s   Length Requiredi  s   Precondition Failedi  s   Request Entity Too Largei  s   Request-URI Too Longi  s   Unsupported Media Typei  s   Requested Range Not Satisfiablei  s   Expectation Failedi  s   I'm a teapoti  s   Unprocessable Entityi  s   Lockedi  s   Failed Dependencyi  s   Upgrade Requiredi  s   Precondition Requiredi  s   Too Many Requestsi  s   Request Header Fields Too Largei  s   Unavailable For Legal Reasonsi  s   Internal Server Errori  s   Not Implementeds   Bad Gateways   Service Unavailables   Gateway Timeouts   HTTP Version Not Supporteds   Variant Also Negotiatess   Insufficient Storages   Loop Detecteds   Not Extendeds   Network Authentication Required)	i  i  i  i  i  i  i  i  i  STATUS_CODES)allowzcontent-encodingzcontent-languagezcontent-lengthzcontent-locationzcontent-md5zcontent-rangezcontent-typeexpireszlast-modifiedzextension-header)
connectionz
keep-alivezproxy-authenticatezproxy-authorizationtetrailersztransfer-encodingupgradec                 C   s"   | dvod|   kodk n   S )z
    According to the following RFC message body and length SHOULD NOT
    be included in responses status 1XX, 204 and 304.
    https://tools.ietf.org/html/rfc2616#section-4.4
    https://tools.ietf.org/html/rfc2616#section-4.3
    )r   r   r
   r    )statusr    r    @/var/www/html/venv/lib/python3.10/site-packages/sanic/helpers.pyhas_message_bodyt   s   "r#   c                 C      |   tv S )z.Checks if the given header is an Entity Header)lower_ENTITY_HEADERSheaderr    r    r"   is_entity_header~      r)   c                 C   r$   )z1Checks if the given header is a Hop By Hop header)r%   _HOP_BY_HOP_HEADERSr'   r    r    r"   is_hop_by_hop_header   r*   r,   c                 C   s8   |  dd\}}t||d}t||}t|r|S | S )z
    import a module or class by string path.

    :module_name: str with path of module or path to import and
    instantiate a class
    :returns: a module object or one instance from class if
    module_name is a valid path to class

    .   )package)rsplitr   getattrr   )module_namer/   moduleklassobjr    r    r"   import_string   s   

r6   returnc                   C   s   t tjotj S N)boolsysstdoutisattyr    r    r    r"   is_atty   s   r=   c                   @   s&   e Zd ZdZdd ZdefddZdS )Defaultz
    It is used to replace `None` or `object()` as a sentinel
    that represents a default value. Sometimes we want to set
    a value to `None` so we cannot use `None` to represent the
    default value, and `object()` is hard to be typed.
    c                 C   s   dS )Nz	<Default>r    selfr    r    r"   __repr__   s   zDefault.__repr__r7   c                 C   s   |   S r8   )rA   r?   r    r    r"   __str__   s   zDefault.__str__N)__name__
__module____qualname____doc__rA   strrB   r    r    r    r"   r>      s    r>   r8   )rF   r:   	functoolsr   	importlibr   inspectr   ujsonr   ujson_dumps
json_dumpsImportErrorjsonr   dictintbytes__annotations__	frozensetr&   r+   r#   r)   r,   r6   r9   r=   r>   _defaultr    r    r    r"   <module>   s   	
 !"#$%&'()*+,-./01234@


