def _parse_mime_message(mime_message):
 if isinstance(mime_message, email.Message.Message):
  return mime_message
 elif isinstance(mime_message, basestring):
  return email.message_from_string(mime_message)
 else:
  return email.message_from_file(mime_message)

def _parse_mime_message ( mime_message ) : if isinstance ( mime_message , email . Message . Message ) : return mime_message elif isinstance ( mime_message , basestring ) : return email . message_from_string ( mime_message ) else : return email . message_from_file ( mime_message )
helper function converts a mime_message in to email .