code: def maybe_annotate(
      character: str,
      text: str,
      annotate_speaker: bool,
      speaker_separator: bool,
      speaker_annotation_position: str,
  ) -> str:
      """
      Annotate text.
  
      Depending on setting of opt arg, either prepend or append.
  
      :param text:
          text to augment
      :param character:
          character to add
      :param annotate_speaker:
          whether to annotate the speaker
      :param speaker_separator:
          whether to incude speaker separator tokens
      :param speaker_annotation_position:
          where to annotate the speaker in the utterance
  
      :return text:
          return augmented text
      """
      if not annotate_speaker:
          return text
      speaker_text = character
      if speaker_separator:
          speaker_text = f"{BEGIN_SPEAKER} {character} {END_SPEAKER}"
      if speaker_annotation_position == "prefix":
          return f"{speaker_text} {text}"
      else:
          return f"{text} {speaker_text}"
  
imports: from collections import deque
  import random
  from typing import Dict
label_desc: Use image node_id 3 for calling a global function with example usage: maybe_annotate(character, text, annotate_speaker, speaker_separator, speaker_annotation_position) and returns: text, speaker_text, str, text, text, str, speaker_text