5,j UddlmZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ej rdd lmZd Zegd Zd Z ddlZn#e$rddlZYnwxYwed z Zn #e$rYnwxYw ejdkrddlmZnddlmZedz Zn #e$rYnwxYwGddeZejZded<ej e!efZ"hdZ# d4d5d!Z$d6d&Z%d7d+Z&Gd,d-ej'Z(d8d3Z)dS)9) annotationsN) b64encode)Enum)UnrewindableBodyError)to_bytes)Finalz@@@SKIP_HEADER@@@)accept-encodinghost user-agentz gzip,deflatez,br))zstdz,zstdceZdZdZdS)_TYPE_FAILEDTELLrN)__name__ __module__ __qualname__tokenDC:\PYTHON\GemmaClient\venv\Lib\site-packages\urllib3/util/request.pyrr,s EEErrzFinal[_TYPE_FAILEDTELL] _FAILEDTELL>GETHEADTRACEDELETECONNECTOPTIONS keep_alive bool | Noneaccept_encodingbool | list[str] | str | None user_agent str | None basic_authproxy_basic_auth disable_cachereturndict[str, str]ci}|rMt|trn2t|trd|}nt}||d<|r||d<|rd|d<|r:dt |d|d<|r:dt |d|d <|rd |d <|S) 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 ``backports.zstd`` package for Python before 3.14) 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 connectionzBasic zlatin-1 authorizationzproxy-authorizationzno-cachez cache-control) isinstancestrlistjoinACCEPT_ENCODINGrencodedecode)r!r#r%r'r(r)headerss r make_headersr8<sd!G5 os + + .   . . .!hh77OO-O%4!"+ * - ,  GYz00;;<<CCEE G G   MY/66yAABBIIKK M M %&.#- Nrbody typing.Anypos_TYPE_BODY_POSITION | Nonec|t||n>t|dd- |}n#t$r t}YnwxYw|S)z If a position is provided, move file to that point. Otherwise, we'll attempt to record a position for future use. Ntell) rewind_bodygetattrr>OSErrorr)r9r;s rset_file_positionrBso D# vt $ $ 0 ))++CC   CCC  Js;AAtyping.IO[typing.AnyStr]body_pos_TYPE_BODY_POSITIONNonec"t|dd}|Et|tr0 ||dS#t$r}t d|d}~wwxYw|t urt dt dt|d)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 .)r@r0intrArr ValueErrortype)r9rD body_seekes rr?r?sfd++IHc!:!:  Ih        'S   [ # 4    QX Q Q Q   s 7 AAAc$eZdZUded<ded<dS)ChunksAndContentLengthztyping.Iterable[bytes] | Nonechunksz int | Nonecontent_lengthN)rrr__annotations__rrrrPrPs*))))rrPtyping.Any | Nonemethodr1 blocksizerJc#d}|tvrd}nd}ntttfr&t f}t |d}ntdrd fd }|}d}n_ t}f}|j }nD#t$r7 t}d}n!#t$rtddwxYwYnwxYwt||S) aRTakes 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. Nrreadr*typing.Iterable[bytes]c3Kttj} }|sdS|r|d}|V5)NTzutf-8)r0io TextIOBaserXr5)r5 datablockrVr9s rchunk_readablez&body_to_chunks..chunk_readablesdbm44F  IIi00  E: ) 0 0 9 9I  rzO'body' must be a bytes-like object, file-like object, or iterable. Instead was )rQrR)r*rY) upper_METHODS_NOT_EXPECTING_BODYr0r1bytesr lenhasattr memoryviewnbytes TypeErroriterrP)r9rUrVrQrRr^mvs` ` rbody_to_chunksrisq$ | <<>>!< < <NN!NN D3, ' '&'4.."VAY v  !'        !! 'D!!BWFYNN    d!%   A8<AA   " O O OOs*B)) C*4CC*C$$C*)C*)NNNNNN)r!r"r#r$r%r&r'r&r(r&r)r"r*r+)r9r:r;r<r*r<)r9rCrDrEr*rF)r9rTrUr1rVrJr*rP)* __future__rr[systypingbase64renumr exceptionsrutilr TYPE_CHECKINGr SKIP_HEADER frozensetSKIPPABLE_HEADERSr4 brotlicffi_unused_module_brotli ImportErrorbrotli version_info compressionr_unused_module_zstd backportsrrrrSUnionrJrEr`r8rBr? NamedTuplerPrirrrrs""""""" ......  " IGGGHH /22222 ///....../ uOO   D  7"";;;;;;;999999wOO   D t(8'= ====l3(8#89WVV#59!!#'!% OOOOOd(    <V. BPBPBPBPBPBPsB AA& AA&AA&&A.-A.2BBB