code: def body_line_iterator(msg, decode=False):
      """Iterate over the parts, returning string payloads line-by-line.
  
      Optional decode (default False) is passed through to .get_payload().
      """
      for subpart in msg.walk():
          payload = subpart.get_payload(decode=decode)
          if isinstance(payload, basestring):
              for line in StringIO(payload):
                  yield line
  
imports: import sys
  from cStringIO import StringIO
label_desc: Use image node_id 2 for calling a global function with example usage: body_line_iterator(msg, decode) without return types