2bi! SSKJr SSKrSSKrSSKrSSKJr SSjrSr SSS .r \ R\ "SS 5Vs0sH,nUS ;dM \RU5S RU5_M. sn5 S rSr\r"SS\5rgs snf))absolute_importN)sixcXU(a"[R"U5S=(d U$U$)z Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. :param default: If no "Content-Type" can be guessed, default to `default`. r) mimetypes guess_type)filenamedefaults ڌ/builddir/build/BUILDROOT/alt-python313-pip-23.3.1-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/pip/_vendor/urllib3/fields.pyguess_content_typer s'##H-a0;G; Nc^[T[R5(aTRS5m[ U4SjS55(dU<ST<S3nUR S5 U$[R(aTR S5m[RRTS5mU<ST<3m[R(aTRS5mT$![ [4a Nf=f)a Helper function to format and quote a single header parameter using the strategy defined in RFC 2231. Particularly useful for header parameters which might contain non-ASCII values, like file names. This follows `RFC 2388 Section 4.4 `_. :param name: The name of the parameter, a string expected to be ASCII only. :param value: The value of the parameter, provided as ``bytes`` or `str``. :ret: An RFC-2231-formatted unicode string. utf-8c3,># UH oT;v M g7fN).0chvalues r .format_header_param_rfc2231..+s/YrU{Ysz"\ =""asciiz*=) isinstancer binary_typedecodeanyencodeUnicodeEncodeErrorUnicodeDecodeErrorPY2emailutilsencode_rfc2231)namerresults ` r format_header_param_rfc2231r(s %)) W% /Y/ / /#U+  MM' "M ww W% KK & &ug 6Ee $E ww W% L!#$67   sC!!C43C4z%22z\\)r\ )z%{:02X}c ^U4Sjn[R"SRTR5Vs/sHn[R"U5PM sn55nUR X 5nU$s snf)Nc,>TURS5$)Nr)group)matchneedles_and_replacementss r replacer#_replace_multiple..replacerSs' A77r |)recompilejoinkeysescapesub)rr0r1needlepatternr's ` r _replace_multipler<Rsc8jj 3K3P3P3RS3R299V$3RSTG[[ )F M Ts A3 c[U[R5(aURS5n[ U[ 5nU<SU<S3$)ay Helper function to format and quote a single header parameter using the HTML5 strategy. Particularly useful for header parameters which might contain non-ASCII values, like file names. This follows the `HTML5 Working Draft Section 4.10.22.7`_ and matches the behavior of curl and modern browsers. .. _HTML5 Working Draft Section 4.10.22.7: https://w3c.github.io/html/sec-forms.html#multipart-form-data :param name: The name of the parameter, a string expected to be ASCII only. :param value: The value of the parameter, provided as ``bytes`` or `str``. :ret: A unicode string, stripped of troublesome characters. rrr)rrrrr<_HTML5_REPLACEMENTS)r&rs r format_header_param_html5r?_s;&%)) W% e%8 9Eu %%r c\\rSrSrSrSS\4Sjr\\4Sj5rSr Sr Sr S S jr S r g) RequestField~a A data container for request body parameters. :param name: The name of this request field. Must be unicode. :param data: The data/value body. :param filename: An optional filename of the request field. Must be unicode. :param headers: An optional dict-like object of headers to initially use for the field. :param header_formatter: An optional callable that is used to encode and format the headers. By default, this is :func:`format_header_param_html5`. NcpXlX0lX l0UlU(a[ U5UlXPlgr)_name _filenamedataheadersdictheader_formatter)selfr&rFr rGrIs r __init__RequestField.__init__s. !  =DL 0r c[U[5(a%[U5S:XaUupEnOUupE[U5nOSnSnUnU"XXCS9nUR US9 U$)aS A :class:`~urllib3.fields.RequestField` factory from old-style tuple parameters. Supports constructing :class:`~urllib3.fields.RequestField` from parameter of key/value strings AND key/filetuple. A filetuple is a (filename, data, MIME type) tuple where the MIME type is optional. For example:: 'foo': 'bar', 'fakefile': ('foofile.txt', 'contents of foofile'), 'realfile': ('barfile.txt', open('realfile').read()), 'typedfile': ('bazfile.bin', open('bazfile').read(), 'image/jpeg'), 'nonamefile': 'contents of nonamefile field', Field names and filenames must be unicode. N)r rI) content_type)rtuplelenr make_multipart)cls fieldnamerrIr rFrO request_params r from_tuplesRequestField.from_tuplessn$ eU # #5zQ/4, !&1(; HLD h  $$,$?r c$URX5$)a Overridable helper function to format a single header parameter. By default, this calls ``self.header_formatter``. :param name: The name of the parameter, a string expected to be ASCII only. :param value: The value of the parameter, provided as a unicode string. )rI)rJr&rs r _render_partRequestField._render_parts$$T11r c/nUn[U[5(aUR5nUH*upEUcM URUR XE55 M, SR U5$)a Helper function to format and quote a single header. Useful for single headers that are composed of multiple items. E.g., 'Content-Disposition' fields. :param header_parts: A sequence of (k, v) tuples or a :class:`dict` of (k, v) to format as `k1="v1"; k2="v2"; ...`. ; )rrHitemsappendrYr6)rJ header_partspartsiterabler&rs r _render_partsRequestField._render_partssc lD ) )#))+H#KD  T..t;<$zz%  r c/n/SQnUHKnURRUS5(dM&URU<SURU<35 MM URR5H-upEXB;dM U(dMURU<SU<35 M/ URS5 SR U5$)z- Renders the headers for this request field. )Content-Disposition Content-TypeContent-LocationFz: z )rGgetr^r]r6)rJlines sort_keyssort_key header_name header_values r render_headersRequestField.render_headerssO !H||%00 (DLL4JKL"*.););)= %K+<LLk  W||E""r c U=(d SURS'URS==SRSURSUR4SUR445/5- ss'X RS'X0RS'g ) a< Makes this request field into a multipart request field. This method overrides "Content-Disposition", "Content-Type" and "Content-Location" headers to the request parameter. :param content_type: The 'Content-Type' of the request body. :param content_location: The 'Content-Location' of the request body. z form-datarer\r&r rfrgN)rGr6rbrDrE)rJcontent_dispositionrOcontent_locations r rRRequestField.make_multiparts/B.Q\ *+ *+uzz""tzz*[$..,IJ 0  +(4 ^$+; '(r )rErDrFrIrG)NNN)__name__ __module__ __qualname____firstlineno____doc__r?rK classmethodrVrYrbrnrR__static_attributes__rr r rArA~sJ(2 1 updaterangeunichrformatr<r?format_header_paramobjectrA)ccs0r rs&  'Vh''B W  . 2 ))"--' &80T<6T