class_docstr: Basic tests on the util functions in TorchAgent.
class_docstr_tok: ["Basic","tests","on","the","util","functions","in","TorchAgent","."]
docstr: Make sure person tokens are added to the write place in text.
docstr_tok: ["Make","sure","person","tokens","are","added","to","the","write","place","in","text","."]
code: def test__add_person_tokens(self):
      """
      Make sure person tokens are added to the write place in text.
      """
      agent = get_agent()
      text = (
          "I've seen things you people wouldn't believe.\n"
          "Attack ships on fire off the shoulder of Orion.\n"
          "I watched C-beams glitter in the dark near the Tannhauser gate.\n"
          "All those moments will be lost in time, like tears in rain."
      )
      prefix = "PRE"
      out = agent.history._add_person_tokens(
          text, prefix, add_after_newln=False
      )
      self.assertEqual(out, prefix + " " + text)
      out = agent.history._add_person_tokens(
          text, prefix, add_after_newln=True
      )
      idx = text.rfind("\n") + 1
      self.assertEqual(out, text[:idx] + prefix + " " + text[idx:])
  
imports: import os
  import unittest
  from parlai.core.agents import create_agent_from_shared
  from parlai.utils.testing import tempdir
  from parlai.utils.misc import Message
label_desc: Use image node_id 8 for calling the TestTorchAgent obj's underlying member method code with example usage: obj.test__add_person_tokens() without return types