class_docstr: Teacher that builds up Message objects based on child `question and answer` and
  `reason` classes.
  
  Also handles making exemplars.
class_docstr_tok: ["Teacher","that","builds","up","Message","objects","based","on","child","`","question","and","answer","`","and","`","reason","`","classes",".","Also","handles","making","exemplars","."]
code: def _message_from_example(
      self,
      example: Dict[str, Any],
      prompt_and_examplars: str,
      inner_separator: str,
      reason_tuple: Optional[t_REASON_PROCESSED_RESULT] = None,
  ) -> Message:
      (
          question,
          answer_prefix,
          answer,
          qa_dict,
      ) = self.question_answer_instance.get_question_answer(example)
  
      message_dict = qa_dict
  
      if self.opt.get("include_reason", True):
          assert reason_tuple is not None
          (
              reason_prefix,
              reason,
              reason_dict,
          ) = reason_tuple
  
          message_dict.update(reason_dict)
  
          if (
              self.opt.get("initial_generation_target", "reason")
              == "other"
          ):
              (
                  example_text,
                  label_prefix,
                  label,
              ) = self.make_custom_input_text_label(
                  question,
                  answer_prefix,
                  answer,
                  reason_prefix,
                  reason,
                  message_dict,
              )
          else:
              example_text = f"{question}{inner_separator}"
              label_prefix = ""
              label = ""
              if self.opt.get("reason_before_answer", True):
                  if (
                      self.opt.get(
                          "initial_generation_target", "reason"
                      )
                      == "reason"
                  ):
                      label_prefix = reason_prefix
                      label = f"{reason}{inner_separator}{answer_prefix}{answer}"
                  else:
                      example_text += (
                          f"{reason_prefix}{reason}{inner_separator}"
                      )
                      label_prefix = answer_prefix
                      label = answer
              else:  # answer before reason
                  if (
                      self.opt.get(
                          "initial_generation_target", "reason"
                      )
                      == "answer"
                  ):
                      label_prefix = answer_prefix
                      label = f"{answer}{inner_separator}{reason_prefix}{reason}"
                  else:
                      example_text += (
                          f"{answer_prefix}{answer}{inner_separator}"
                      )
                      label_prefix = reason_prefix
                      label = reason
  
      else:  # case without reason is simple, just get the answer
          example_text = f"{question}{inner_separator}"
          label_prefix = answer_prefix
          label = answer
  
      if self.opt.get("include_generation_target_token_in_input", True):
          example_text += label_prefix
      else:
          label = label_prefix + label
  
      message_dict["text"] = prompt_and_examplars + example_text
      message_dict["label"] = label
  
      return Message(message_dict)
  
imports: from parlai.core.opt import Opt
  from parlai.core.message import Message
  from parlai.core.params import ParlaiParser
  from parlai.core.teachers import DialogTeacher
  from tqdm import tqdm
  from typing import Any, Dict, Iterable, List, Optional, Tuple
label_desc: Use image node_id 14 for calling the AbstractReasoningTeacher obj's underlying member method code with example usage: obj._message_from_example(example, prompt_and_examplars, inner_separator, reason_tuple) and returns: Message