docstr: Ensure that the memory has a "persona" prefix.
  
  :param memory:
      memory to prefix
  :param self_or_partner:
      string representing if this is a self memory or partner memory
  :param model_type:
      which model we're working with
  
  :return prefixed_mem:
      return a memory with the appropriate prefix.
docstr_tok: ["Ensure","that","the","memory","has","a","``","persona","''","prefix",".",":","param","memory",":","memory","to","prefix",":","param","self_or_partner",":","string","representing","if","this","is","a","self","memory","or","partner","memory",":","param","model_type",":","which","model","we","'re","working","with",":","return","prefixed_mem",":","return","a","memory","with","the","appropriate","prefix","."]
code: def add_memory_prefix(
      cls, memory: str, self_or_partner: str, model_type: str
  ) -> str:
      """
      Ensure that the memory has a "persona" prefix.
  
      :param memory:
          memory to prefix
      :param self_or_partner:
          string representing if this is a self memory or partner memory
      :param model_type:
          which model we're working with
  
      :return prefixed_mem:
          return a memory with the appropriate prefix.
      """
      assert self_or_partner in ["self", "partner"]
      assert model_type in ["R2C2", "OPT"]
      prefix = MemoryUtils.get_memory_prefix(
          self_or_partner, model_type
      )
      if model_type == "R2C2":
          if not memory.startswith(prefix):
              memory = f"{prefix}: {memory}"
      elif self_or_partner == "self":
          memory = memory.replace("Person 1", "Person 2")
          if not memory.startswith("Person"):
              memory = f"{prefix}: {memory}"
      else:
          memory = memory.replace("Person 2", "Person 1")
          if not memory.startswith("Person"):
              memory = f"{prefix}: {memory}"
  
      return memory
  
imports: import aiohttp
  import asyncio
  from enum import Enum
  import json
  import math
  from nltk.corpus import stopwords
  from nltk.tokenize import word_tokenize
  from nltk.stem import PorterStemmer
  import os
  import random
  import string
  import time
  from typing import List, Tuple, Optional, Dict, Any, Set, Union
  from parlai.agents.ir_baseline.ir_baseline import score_match, MaxPriorityQueue
  from parlai.core.dict import DictionaryAgent
  from parlai.core.message import Message
  from parlai.core.metrics import F1Metric
  from parlai.core.torch_generator_agent import PPLMetric
  import parlai.utils.logging
  import projects.bb3.constants
  import projects.bb3.prompts
  from projects.bb3.agents.module import Module
label_desc: Use image node_id 8 for calling the MemoryUtils obj's underlying member method code with example usage: obj.add_memory_prefix(cls, memory, _or_partner, model_type) and returns: memory