{f[ 6ddlmZddlZddlZddlZddlZddlmZddlm Z m Z ejddZ ejejejee fe fZejeej$ee ffZd dZd d Z d dd Zy)) annotationsN)BytesIO)_TYPE_FIELD_VALUE_TUPLE RequestFieldzutf-8cntjtjdj S)zN Our embarrassingly-simple replacement for mimetools.choose_boundary. )binasciihexlifyosurandomdecodeY/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/urllib3/filepost.pychoose_boundaryrs&   BJJrN + 2 2 44rc#Kt|tjr|j}n|}|D]+}t|tr|t j |-yw)z Iterate over fields. Supports list of (k, v) tuples and dicts, and lists of :class:`~urllib3.fields.RequestField`. N) isinstancetypingMappingitemsr from_tuples)fieldsiterablefields riter_field_objectsrsP&&..)<<> e\ *K**E2 2 sAA!cDt}| t}t|D]}|jd|dj dt |j|j |j}t|tr t|}t|trt |j|n|j||jd|jd|dj dd|}|j|fS)a Encode a dictionary of ``fields`` using the multipart/form-data MIME format. :param fields: Dictionary of fields or list of (key, :class:`~urllib3.fields.RequestField`). Values are processed by :func:`urllib3.fields.RequestField.from_tuples`. :param boundary: If not specified, then a random boundary will be generated using :func:`urllib3.filepost.choose_boundary`. z--z zlatin-1s z-- zmultipart/form-data; boundary=) rrrwriteencodewriterrender_headersdatarintstrgetvalue)rboundarybodyrr# content_types rencode_multipart_formdatar*3s 9D"$#F+ Rz&--i89t 5//12zz dC t9D dC 4L  t $ JJt  7,  JJH:V$++I673H:>L ==?L ((r)returnr%)r _TYPE_FIELDSr+ztyping.Iterable[RequestField])N)rr,r'z str | Noner+ztuple[bytes, str]) __future__rr codecsr riorrrrlookupr!SequenceUnionTupler%_TYPE_FIELDS_SEQUENCErr,rrr*rrrr5s" 9 w  " LLc#::;\IJ|| NN3//02 53.26&) &)$.&)&)r