(
            cls,
            fieldname,
            value,
            header_formatter=format_header_param_html5)
return request_param
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.
A :class:`~urllib3.fields.RequestField` factory from old-style tuple parameters.
A : class : ~urllib3 . fields . RequestField factory from old - style tuple parameters .
def from_tuples(
            cls,
            fieldname,
            value,
            header_formatter=format_header_param_html5):
        """
        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.
        """
        if isinstance(value, tuple):
            if len(value) == 3:
                filename, data, content_type = value
            else:
                filename, data = value
                content_type = guess_content_type(filename)
        else:
            filename = None
            content_type = None
            data = value

        request_param = cls(
            fieldname, data, filename=filename, header_formatter=header_formatter)
        request_param.make_multipart(content_type=content_type)

        return request_param
def from_tuples ( cls , fieldname , value , header_formatter = format_header_param_html5 ) : if isinstance ( value , tuple ) : if len ( value ) == 3 : filename , data , content_type = value else : filename , data = value content_type = guess_content_type ( filename ) else : filename = None content_type = None data = value request_param = cls ( fieldname , data , filename = filename , header_formatter = header_formatter ) request_param . make_multipart ( content_type = content_type ) return request_param