code: def message_as_get_body(self, body_parts, attachments, parts, msg):
      m = self._str_msg(msg)
      allparts = list(m.walk())
      expected = [
          None if n is None else allparts[n] for n in body_parts
      ]
      related = 0
      html = 1
      plain = 2
      self.assertEqual(m.get_body(), first(expected))
      self.assertEqual(
          m.get_body(preferencelist=("related", "html", "plain")),
          first(expected),
      )
      self.assertEqual(
          m.get_body(preferencelist=("related", "html")),
          first(expected[related : html + 1]),
      )
      self.assertEqual(
          m.get_body(preferencelist=("related", "plain")),
          first([expected[related], expected[plain]]),
      )
      self.assertEqual(
          m.get_body(preferencelist=("html", "plain")),
          first(expected[html : plain + 1]),
      )
      self.assertEqual(
          m.get_body(preferencelist=["related"]), expected[related]
      )
      self.assertEqual(
          m.get_body(preferencelist=["html"]), expected[html]
      )
      self.assertEqual(
          m.get_body(preferencelist=["plain"]), expected[plain]
      )
      self.assertEqual(
          m.get_body(preferencelist=("plain", "html")),
          first(expected[plain : html - 1 : -1]),
      )
      self.assertEqual(
          m.get_body(preferencelist=("plain", "related")),
          first([expected[plain], expected[related]]),
      )
      self.assertEqual(
          m.get_body(preferencelist=("html", "related")),
          first(expected[html::-1]),
      )
      self.assertEqual(
          m.get_body(preferencelist=("plain", "html", "related")),
          first(expected[::-1]),
      )
      self.assertEqual(
          m.get_body(preferencelist=("html", "plain", "related")),
          first([expected[html], expected[plain], expected[related]]),
      )
  
imports: import unittest
  import textwrap
  from email import policy, message_from_string
  from email.message import EmailMessage, MIMEPart
  from test.test_email import TestEmailBase, parameterize
label_desc: Use image node_id 1 for calling the TestEmailMessageBase obj's underlying member method code with example usage: obj.message_as_get_body(body_parts, attachments, parts, msg) without return types