def process_multipart_form_data(entity):
 process_multipart(entity)
 kept_parts = []
 for part in entity.parts:
  if (part.name is None):
   kept_parts.append(part)
  else:
   if (part.filename is None):
    value = part.fullvalue()
   else:
    value = part
   if (part.name in entity.params):
    if (not isinstance(entity.params[part.name], list)):
     entity.params[part.name] = [entity.params[part.name]]
    entity.params[part.name].append(value)
   else:
    entity.params[part.name] = value
 entity.parts = kept_parts

def process_multipart_form_data ( entity ) : process_multipart ( entity ) kept_parts = [ ] for part in entity . parts : if ( part . name is None ) : kept_parts . append ( part ) else : if ( part . filename is None ) : value = part . fullvalue ( ) else : value = part if ( part . name in entity . params ) : if ( not isinstance ( entity . params [ part . name ] , list ) ) : entity . params [ part . name ] = [ entity . params [ part . name ] ] entity . params [ part . name ] . append ( value ) else : entity . params [ part . name ] = value entity . parts = kept_parts
read all multipart/form-data parts into entity .