
    #h                     B   % S SK Jr  S SKrS SKrS SKJr  S SKJr  SSKJ	r	  SSK
Jr  \R                  (       a  S S	KJr  S
r\" / SQ5      rSr  S SKr\S-  r S SKJr  \S-  r " S S\5      r\R6                  rS\S'   \R<                  \\4   r 1 Skr!      S             SS jjr"      SS jr#SS jr$ " S S\RJ                  5      r&        SS jr'g! \ a    S SKr Nf = f! \ a     Nf = f! \ a     S SKr\S-  r N! \ a      Nf = ff = f)     )annotationsN)	b64encode)Enum   )UnrewindableBodyError   )to_bytes)Finalz@@@SKIP_HEADER@@@)accept-encodinghost
user-agentzgzip,deflatez,br)zstdz,zstdc                      \ rS rSrSrSrg)_TYPE_FAILEDTELL/   r    N)__name__
__module____qualname____firstlineno__token__static_attributes__r       T/Users/user/Downloads/htwk/venv/lib/python3.13/site-packages/urllib3/util/request.pyr   r   /   s    Er   r   zFinal[_TYPE_FAILEDTELL]_FAILEDTELL>   GETHEADTRACEDELETECONNECTOPTIONSc                   0 nU(       aG  [        U[        5      (       a  O-[        U[        5      (       a  SR                  U5      nO[        nXS'   U(       a  X&S'   U (       a  SUS'   U(       a.  S[        UR                  S5      5      R                  5        3US'   U(       a.  S[        UR                  S5      5      R                  5        3US	'   U(       a  S
US'   U$ )a  
Shortcuts for generating request headers.

:param keep_alive:
    If ``True``, adds 'connection: keep-alive' header.

:param accept_encoding:
    Can be a boolean, list, or string.
    ``True`` translates to 'gzip,deflate'.  If the dependencies for
    Brotli (either the ``brotli`` or ``brotlicffi`` package) and/or Zstandard
    (the ``zstandard`` package) algorithms are installed, then their encodings are
    included in the string ('br' and 'zstd', respectively).
    List will get joined by comma.
    String will be used as provided.

:param user_agent:
    String representing the user-agent you want, such as
    "python-urllib3/0.6"

:param basic_auth:
    Colon-separated username:password string for 'authorization: basic ...'
    auth header.

:param proxy_basic_auth:
    Colon-separated username:password string for 'proxy-authorization: basic ...'
    auth header.

:param disable_cache:
    If ``True``, adds 'cache-control: no-cache' header.

Example:

.. code-block:: python

    import urllib3

    print(urllib3.util.make_headers(keep_alive=True, user_agent="Batman/1.0"))
    # {'connection': 'keep-alive', 'user-agent': 'Batman/1.0'}
    print(urllib3.util.make_headers(accept_encoding=True))
    # {'accept-encoding': 'gzip,deflate'}
,r   r   z
keep-alive
connectionzBasic zlatin-1authorizationzproxy-authorizationzno-cachezcache-control)
isinstancestrlistjoinACCEPT_ENCODINGr   encodedecode)
keep_aliveaccept_encoding
user_agent
basic_authproxy_basic_authdisable_cacheheaderss          r   make_headersr4   ?   s    b !Gos++..!hh7O-O%4!" * ,Yz00;<CCEFG 	  Y/66yABIIKLM 	%& #- Nr   c                    Ub  [        X5        U$ [        U SS5      b   U R                  5       nU$ U$ ! [         a
    [        n U$ f = f)zs
If a position is provided, move file to that point.
Otherwise, we'll attempt to record a position for future use.
Ntell)rewind_bodygetattrr6   OSErrorr   )bodyposs     r   set_file_positionr<      sa     D J 
vt	$	0	))+C J3J  	 CJ	s   4 AAc                    [        U SS5      nUb  [        U[        5      (       a
   U" U5        gU[
        L a  [	        S5      e[        S[        U5       S35      e! [         a  n[	        S5      UeSnAff = f)z
Attempt to rewind body to a certain position.
Primarily used for request redirects and retries.

:param body:
    File-like object that supports seek.

:param int pos:
    Position to seek to in file.
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 .)r8   r&   intr9   r   r   
ValueErrortype)r:   body_pos	body_seekes       r   r7   r7      s     fd+IHc!:!:	h
 
[	 #4
 	

 ?X?OqQ
 	
  	'S	s   A 
A7&A22A7c                  *    \ rS rSr% S\S'   S\S'   Srg)ChunksAndContentLength   ztyping.Iterable[bytes] | Nonechunksz
int | Nonecontent_lengthr   N)r   r   r   r   __annotations__r   r   r   r   rG   rG      s    ))r   rG   c                  ^ ^ T c   SnUR                  5       [        ;  a  SnOxSnOu[        T [        [        45      (       a  [        T 5      4n[        US   5      nO?[        T S5      (       a  SUU 4S jjnU" 5       nSnO [        T 5      nT 4nUR                  n[        X4S9$ ! [         a/     [        T 5      nSn N#! [         a    [        ST < 35      Sef = ff = f)a:  Takes the HTTP request method, body, and blocksize and
transforms them into an iterable of chunks to pass to
socket.sendall() and an optional 'Content-Length' header.

A 'Content-Length' of 'None' indicates the length of the body
can't be determined so should use 'Transfer-Encoding: chunked'
for framing instead.
Nr   readc               3     >#    [        T[        R                  5      n  TR                  T5      nU(       d  g U (       a  UR	                  S5      nUv   M7  7f)Nzutf-8)r&   io
TextIOBaserM   r+   )r+   	datablock	blocksizer:   s     r   chunk_readable&body_to_chunks.<locals>.chunk_readable   sJ     bmm4F IIi0	  ) 0 0 9I s   AAzO'body' must be a bytes-like object, file-like object, or iterable. Instead was )rI   rJ   )returnztyping.Iterable[bytes])upper_METHODS_NOT_EXPECTING_BODYr&   r'   bytesr	   lenhasattr
memoryviewnbytes	TypeErroriterrG   )r:   methodrR   rI   rJ   rS   mvs   ` `    r   body_to_chunksra      s    $ |<<>!<<N!N 
D3,	'	'4."VAY 
v				  		   !	'D!B WFYYN!OO  		d!% 88<xA 		s   B$ $
C/B>>CC)NNNNNN)r-   bool | Noner.   zbool | list[str] | str | Noner/   
str | Noner0   rc   r1   rc   r2   rb   rU   zdict[str, str])r:   z
typing.Anyr;   _TYPE_BODY_POSITION | NonerU   rd   )r:   ztyping.IO[typing.AnyStr]rC   _TYPE_BODY_POSITIONrU   None)r:   ztyping.Any | Noner_   r'   rR   r@   rU   rG   )(
__future__r   rO   typingbase64r   enumr   
exceptionsr   utilr	   TYPE_CHECKINGr
   SKIP_HEADER	frozensetSKIPPABLE_HEADERSr*   
brotlicffi_unused_module_brotliImportErrorbrotlicompressionr   _unused_module_zstd	zstandardr   r   r   rK   Unionr@   re   rW   r4   r<   r7   
NamedTuplerG   ra   r   r   r   <module>rz      s   " 	    . 	 "GH  /2 uO wOt  (8'='=$ =ll3(8#89  W  #59!!#'!%NN2N N 	N
 !N N Nb
5(
<V.. 
CP
CP%(CP58CPCP]  /./ 		  /7" sT   C" C> "
C/,C2 .C//C2 2C;:C;>D	DDDDD