HEX
Server: LiteSpeed
System: Linux s787.bom1.mysecurecloudhost.com 4.18.0-477.13.1.lve.el8.x86_64 #1 SMP Thu Jun 1 16:40:47 EDT 2023 x86_64
User: mobilech (5348)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/urllib3/__pycache__/filepost.cpython-310.pyc
o

;jT	�@s�ddlmZddlZddlZddlZddlZddlmZddlm	Z	m
Z
e�d�dZej
ejeee	fe
fZejeejee	ffZdd
d�Zddd�Z	dddd�ZdS)�)�annotationsN)�BytesIO�)�_TYPE_FIELD_VALUE_TUPLE�RequestFieldzutf-8��return�strcCst�t�d����S)zN
    Our embarrassingly-simple replacement for mimetools.choose_boundary.
    �)�binascii�hexlify�os�urandom�decode�rr�D/opt/saltstack/salt/lib/python3.10/site-packages/urllib3/filepost.py�choose_boundarysr�fields�_TYPE_FIELDS�typing.Iterable[RequestField]ccsH�t|tj�r|��}n|}|D]}t|t�r|Vqtj|�VqdS)z�
    Iterate over fields.

    Supports list of (k, v) tuples and dicts, and lists of
    :class:`~urllib3.fields.RequestField`.

    N)�
isinstance�typing�Mapping�itemsrZfrom_tuples)r�iterable�fieldrrr�iter_field_objectss�


�r�boundary�
str | None�tuple[bytes, str]cCs�t�}|dur
t�}t|�D]:}|�d|�d��d��t|��|���|j}t|t	�r1t
|�}t|t
�r>t|��|�n|�|�|�d�q|�d|�d��d��d|��}|��|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�write�encode�writerZrender_headers�datar�intr	�getvalue)rr�bodyrr#�content_typerrr�encode_multipart_formdata3s 



r()rr	)rrrr)N)rrrrrr)�
__future__rr�codecsr
r�iorrrr�lookupr"�Sequence�Union�tupler	Z_TYPE_FIELDS_SEQUENCErrrrr(rrrr�<module>s(���

�