bg[ ddlmZddlZddlZddlZddlZddlmZddlm Z m Z ej ddZ ej ejejee fe fZejeejee ffZdd ZddZ dddZdS)) annotationsN)BytesIO)_TYPE_FIELD_VALUE_TUPLE RequestFieldzutf-8returnstrcrtjtjdS)zN Our embarrassingly-simple replacement for mimetools.choose_boundary. )binasciihexlifyosurandomdecodeG/opt/cloudlinux/venv/lib64/python3.11/site-packages/urllib3/filepost.pychoose_boundaryrs)  BJrNN + + 2 2 4 44rfields _TYPE_FIELDStyping.Iterable[RequestField]c#Kt|tjr|}n|}|D],}t|tr|Vt j|V-dS)z Iterate over fields. Supports list of (k, v) tuples and dicts, and lists of :class:`~urllib3.fields.RequestField`. N) isinstancetypingMappingitemsr from_tuples)riterablefields riter_field_objectsr!s}&&.))<<>>33 e\ * * 3KKKK*E2 2 2 2 2 33rboundary str | Nonetuple[bytes, str]ct}|t}t|D]}|d|ddt |||j}t|trt|}t|tr#t ||n|||d|d|ddd|}| |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`. Nz--z zlatin-1s z-- zmultipart/form-data; boundary=) rrr!writeencodewriterrender_headersdatarintr getvalue)rr"bodyr r* content_types rencode_multipart_formdatar/3sM 99D"$$#F++ &&&&--i88999t 5//11222z dC  t99D dC   4LL  t $ $ $ $ JJt    7JJ$H$$$++I66777>H>>L ==??L ((r)r r )rrr r)N)rrr"r#r r$) __future__rr codecsrriorrrrlookupr(SequenceUnionTupler _TYPE_FIELDS_SEQUENCErrrr!r/rrrr8s"""""" 99999999 w   " Lc#::;\IJ| N3//02 55553333.26&)&)&)&)&)&)&)r