code: def encode_multipart_data(data=(), files=()):
      
      if isinstance(data, Mapping):
          data = data.items()
      if isinstance(files, Mapping):
          files = files.items()
      message = build_multipart_message(chain(data, files))
      headers, body = encode_multipart_message(message)
      return body, dict(headers)
docs: Create a MIME multipart payload from L{data} and L{files}.
  
      **Note** that this function is deprecated. Use `build_multipart_message`
      and `encode_multipart_message` instead.
  
      @param data: A mapping of names (ASCII strings) to data (byte string).
      @param files: A mapping of names (ASCII strings) to file objects ready to
          be read.
      @return: A 2-tuple of C{(body, headers)}, where C{body} is a a byte string
          and C{headers} is a dict of headers to add to the enclosing request in
          which this payload will travel.