human
Solve the following python programming problem given the following code:
def encode_multipart_data(self) : 
    def encode(data) : 
        if isinstance (data, text_type) : 
            data = data.encode ('utf-8') 
return data 
boundary = choose_boundary () 
    body = BytesIO () 
    for (key, value) in self.data.items () : 
        body.write (encode (('--%s\r
' % boundary))) 
        body.write (encode (('Content-Disposition: form-data.
name="%s"' % key))) 
        body.write (encode ((('\r
\r
' + str (value)) + '\r
'))) 
for _file in self.files : 
        body.write (encode (('--%s\r
' % boundary))) 
        body.write (encode (('Content-Disposition: form-data.
name="file".
filename="%s"\r
' % _file))) 
        body.write (encode ((('Content-Type: %s\r
' % mimetypes.guess_type (_file) [0]) or 'application/octet-stream'))) 
        body.write (encode ('\r
')) 
        try : 
            with open (_file, 'rb') as f : 
                data = f.read () 
                body.write (encode (content_type)) 
except IOError : 
            raise 
body.write (encode ('\r
')) 
body.write (encode (('--%s--\r
\r
' % boundary))) 
    content_type = ('multipart/form-data.
boundary=%s' % boundary) 
    return (content_type, body.getvalue ()) 

    
    

    Fix the buggy line: body.write (encode (content_type))
assistant
#Here is Python code to fix the buggy line: body.

body.write (encode (data))