class_docstr: Basic message object.
  
  A message object is defined as something that has a bunch of RFC 2822
  headers and a payload.  It may optionally have an envelope header
  (a.k.a. Unix-From or From_ header).  If the message is a container (i.e. a
  multipart or a message/rfc822), then the payload is a list of Message
  objects, otherwise it is a string.
  
  Message objects implement part of the `mapping' interface, which assumes
  there is exactly one occurrence of the header per message.  Some headers
  do in fact appear multiple times (e.g. Received) and for those headers,
  you must use the explicit API to set or get all the headers.  Not all of
  the mapping methods are implemented.
docstr: Return a reference to the payload.
  
  The payload will either be a list object or a string.  If you mutate
  the list object, you modify the message's payload in place.  Optional
  i returns that index into the payload.
  
  Optional decode is a flag indicating whether the payload should be
  decoded or not, according to the Content-Transfer-Encoding header
  (default is False).
  
  When True and the message is not a multipart, the payload will be
  decoded if this header's value is `quoted-printable' or `base64'.  If
  some other encoding is used, or the header is missing, or if the
  payload has bogus data (i.e. bogus base64 or uuencoded data), the
  payload is returned as-is.
  
  If the message is a multipart and the decode flag is True, then None
  is returned.
docstr_tok: ["Return","a","reference","to","the","payload",".","The","payload","will","either","be","a","list","object","or","a","string",".","If","you","mutate","the","list","object",",","you","modify","the","message","'s","payload","in","place",".","Optional","i","returns","that","index","into","the","payload",".","Optional","decode","is","a","flag","indicating","whether","the","payload","should","be","decoded","or","not",",","according","to","the","Content-Transfer-Encoding","header","(","default","is","False",")",".","When","True","and","the","message","is","not","a","multipart",",","the","payload","will","be","decoded","if","this","header","'s","value","is","`","quoted-printable","'","or","`","base64","'",".","If","some","other","encoding","is","used",",","or","the","header","is","missing",",","or","if","the","payload","has","bogus","data","(","i.e",".","bogus","base64","or","uuencoded","data",")",",","the","payload","is","returned","as-is",".","If","the","message","is","a","multipart","and","the","decode","flag","is","True",",","then","None","is","returned","."]
code: def get_payload(self, i=None, decode=False):
      """Return a reference to the payload.
  
      The payload will either be a list object or a string.  If you mutate
      the list object, you modify the message's payload in place.  Optional
      i returns that index into the payload.
  
      Optional decode is a flag indicating whether the payload should be
      decoded or not, according to the Content-Transfer-Encoding header
      (default is False).
  
      When True and the message is not a multipart, the payload will be
      decoded if this header's value is `quoted-printable' or `base64'.  If
      some other encoding is used, or the header is missing, or if the
      payload has bogus data (i.e. bogus base64 or uuencoded data), the
      payload is returned as-is.
  
      If the message is a multipart and the decode flag is True, then None
      is returned.
      """
      if i is None:
          payload = self._payload
      elif not isinstance(self._payload, list):
          raise TypeError("Expected list, got %s" % type(self._payload))
      else:
          payload = self._payload[i]
      if decode:
          if self.is_multipart():
              return None
          cte = self.get("content-transfer-encoding", "").lower()
          if cte == "quoted-printable":
              return utils._qdecode(payload)
          elif cte == "base64":
              try:
                  return utils._bdecode(payload)
              except binascii.Error:
                  # Incorrect padding
                  return payload
          elif cte in ("x-uuencode", "uuencode", "uue", "x-uue"):
              sfp = StringIO()
              try:
                  uu.decode(StringIO(payload + "\n"), sfp, quiet=True)
                  payload = sfp.getvalue()
              except uu.Error:
                  # Some decoding problem
                  return payload
      # Everything else, including encodings with 8bit or 7bit are returned
      # unchanged.
      return payload
  
imports: import re
  import uu
  import binascii
  import warnings
  from cStringIO import StringIO
  import email.charset
  from email import utils
  from email import errors
label_desc: Use image node_id 8 for calling the Message obj's underlying member method code with example usage: obj.get_payload(i, decode) and returns: payload, None, utils, utils, payload, payload