Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
request.cpython-313.pyc111 linesDownload Raw Back to __pycache__
1�

2��j� ��J�%SSKJr SSKrSSKrSSKrSSKJr SSKJr SSK	J3r4 SSKJr \R(aSS	KJr S5r\"/SQ5rSrSSKr\S
-
r\R.S:�aSSKJr OSSKJr \S-
r"SS\5r\R:rS\S'\R@\!\4r"1Skr#SSSjjr$SSjr%SSjr&"SS\RN5r(S Sjr)g!\a SSKrN�f=f!\a N�f=f!\a N�f=f)!�)�annotationsN)�	b64encode)�Enum�)�UnrewindableBodyError�)�to_bytes)�Finalz@@@SKIP_HEADER@@@)�accept-encoding�host�6user-agentzgzip,deflatez,br)��)�zstdz,zstdc��\rSrSrSrSrg)�_TYPE_FAILEDTELL�,r�N)�__name__�7__module__�__qualname__�__firstlineno__�token�__static_attributes__r��ZD:\code\apps\devtools\python\user_packages\Python313\site-packages\urllib3/util/request.pyrr,s��
�ErrzFinal[_TYPE_FAILEDTELL]�_FAILEDTELL>�GET�HEAD�TRACE�DELETE�CONNECT�OPTIONSc���0nU(aG[U[5(aO-[U[5(aSRU5nO[nXS'U(aX&S'U(aSUS'U(a.S[UR
S55R53US'U(a.S[UR
S55R53US	'U(aS8US'U$)a9Shortcuts for generating request headers.10 11:param keep_alive:12    If ``True``, adds 'connection: keep-alive' header.13 14:param accept_encoding:15    Can be a boolean, list, or string.16    ``True`` translates to 'gzip,deflate'.  If the dependencies for17    Brotli (either the ``brotli`` or ``brotlicffi`` package) and/or18    Zstandard (the ``backports.zstd`` package for Python before 3.14)19    algorithms are installed, then their encodings are20    included in the string ('br' and 'zstd', respectively).21    List will get joined by comma.22    String will be used as provided.23 24:param user_agent:25    String representing the user-agent you want, such as26    "python-urllib3/0.6"27 28:param basic_auth:29    Colon-separated username:password string for 'authorization: basic ...'30    auth header.31 32:param proxy_basic_auth:33    Colon-separated username:password string for 'proxy-authorization: basic ...'34    auth header.35 36:param disable_cache:37    If ``True``, adds 'cache-control: no-cache' header.38 39Example:40 41.. code-block:: python42 43    import urllib344 45    print(urllib3.util.make_headers(keep_alive=True, user_agent="Batman/1.0"))46    # {'connection': 'keep-alive', 'user-agent': 'Batman/1.0'}47    print(urllib3.util.make_headers(accept_encoding=True))48    # {'accept-encoding': 'gzip,deflate'}49�,rr
z50keep-alive�51connectionzBasic zlatin-1�
authorizationzproxy-authorizationzno-cachez
cache-control)�52isinstance�str�list�join�ACCEPT_ENCODINGr�encode�decode)�53keep_alive�accept_encoding�54user_agent�55basic_auth�proxy_basic_auth�
disable_cache�headerss       r�make_headersr6<s���d!�G���o�s�+�+��
���
.�
.�!�h�h��7�O�-�O�%4�!�"�� *���� ,������Y�z�0�0��;�<�C�C�E�F�G�	�� ���Y�/�6�6�y�A�B�I�I�K�L�M�	�%�&��#-��� ��Nrc��Ub
[X5 U$[USS5bUR5nU$U$![a56 [nU$f=f)zs57If a position is provided, move file to that point.58Otherwise, we'll attempt to record a position for future use.59N�tell)�rewind_body�getattrr8�OSErrorr)�body�poss  r�set_file_positionr>�sa�����D���J�60��v�t�	$�	0�	��)�)�+�C��J�3�J���	��C��J�	�s�4�A�Ac���[USS5nUb[U[5(a61U"U5 gU[62La[	S5e[
S[U5S35e![an[	S5UeSnAff=f)z�63Attempt to rewind body to a certain position.64Primarily used for request redirects and retries.65 66:param body:67    File-like object that supports seek.68 69:param int pos:70    Position to seek to in file.71�seekNzAAn error occurred when rewinding request body for redirect/retry.zRUnable to record file position for rewinding request body during a redirect/retry.z1body_pos must be of type integer, instead it was �.)r:r(�intr;rr�72ValueError�type)r<�body_pos�	body_seek�es    rr9r9�s�����f�d�+�I����H�c�!:�!:�	��h��7374�[�	 �#�
4�75�	76�77�?��X��?O�q�Q�78�	79���	�'�S���
��	�s�A�80A7�&A2�2A7c�*�\rSrSr%S\S'S\S'Srg)�ChunksAndContentLength��ztyping.Iterable[bytes] | None�chunksz81int | None�content_lengthrN)rrrr�__annotations__rrrrrIrI�s��)�)��rrIc��^^�Tc SnUR5[;aSnOxSnOu[T[[45(a[T54n[
US5nO?[TS5(aSUU4SjjnU"5nSnO[T5nT4nURn[X4S9$![a/ [T5nSnN#![a [ST<35Sef=ff=f)a:Takes the HTTP request method, body, and blocksize and82transforms them into an iterable of chunks to pass to83socket.sendall() and an optional 'Content-Length' header.84 85A 'Content-Length' of 'None' indicates the length of the body86can't be determined so should use 'Transfer-Encoding: chunked'87for framing instead.88Nr�readc3�># �[T[R5nTRT5nU(dgU(aUR	S5nUv� M77f)Nzutf-8)r(�io�89TextIOBaserOr-)r-�	datablock�	blocksizer<s  ��r�chunk_readable�&body_to_chunks.<locals>.chunk_readable�sJ������b�m�m�4�F�� �I�I�i�0�	� ��� )� 0� 0�� 9�I���
�s�AAzO'body' must be a bytes-like object, file-like object, or iterable. Instead was )rKrL)�returnztyping.Iterable[bytes])
�upper�_METHODS_NOT_EXPECTING_BODYr(r)�bytesr	�len�hasattr�90memoryview�nbytes�	TypeError�iterrI)r<�methodrTrKrLrU�mvs` `    r�body_to_chunksrc�s����$�|����<�<�>�!<�<��N�!�N�91�D�3��,�	'�	'��4�.�"���V�A�Y���92��v�	�	�	 �	 � �!����	'��D�!�B��W�F��Y�Y�N�!��O�O���		�
��d���!%����
��8�8<�x�A����
��		�s�B$�$93C�/
B>�>C�C)NNNNNN)r/�bool | Noner0zbool | list[str] | str | Noner1�94str | Noner2rer3rer4rdrWzdict[str, str])r<z95typing.Anyr=�_TYPE_BODY_POSITION | NonerWrf)r<ztyping.IO[typing.AnyStr]rE�_TYPE_BODY_POSITIONrW�None)r<ztyping.Any | Nonerar)rTrBrWrI)*�96__future__rrQ�sys�typing�base64r�enumr�97exceptionsr�utilr	�
TYPE_CHECKINGr98�SKIP_HEADER�	frozenset�SKIPPABLE_HEADERSr,�99brotlicffi�_unused_module_brotli�ImportError�brotli�version_info�compressionr�_unused_module_zstd�	backportsrrrrM�UnionrBrgrYr6r>r9�100NamedTuplerIrcrrr�<module>r~s���"�	�101�
���.��	����"���G�H�� ���/�2��u��O��102���7�"�;�9��w��O��t��(8�'=�'=��
$�=��l�l�3�(8�#8�9��W��#�59�!�!�#'�!%�
O��O�2�O��O��	O�103!�O��
O��O�d�104��5����(105�<�V�.�.��106BP�107�BP�%(�BP�58�BP��BP��W�/�.�/���	��	���	��	�s<�C=�D�=108D109�D
�	D110�111D
�
D�D�D"�!D"
codekingpro/portable-devtools · Team Ai