code: def setup_args(parser=None):
      if parser is None:
          parser = ParlaiParser(
              True, True, "Generate self-chats of a model"
          )
      parser.add_argument("--seed", type=int, default=42)
      parser.add_argument(
          "-d", "--display-examples", type="bool", default=True
      )
      parser.add_argument(
          "--display-add-fields",
          type=str,
          default="",
          help='Display these fields when verbose is off (e.g., "--display-add-fields label_candidates,beam_texts")',
      )
      parser.add_argument(
          "-st",
          "--selfchat-task",
          type="bool",
          default=True,
          help="Create a self chat version of the task",
      )
      parser.add_argument(
          "--num-self-chats",
          type=int,
          default=1,
          help="Number of self chats to run",
      )
      parser.add_argument(
          "--selfchat-max-turns",
          type=int,
          default=6,
          help="The number of dialogue turns before self chat ends",
      )
      parser.add_argument(
          "--seed-messages-from-task",
          type="bool",
          default=False,
          help="Automatically seed conversation with messages from task dataset.",
      )
      parser.add_argument(
          "--seed-messages-from-file",
          default=None,
          help="If specified, loads newline-separated strings from the file as conversation starters.",
      )
      parser.add_argument(
          "--outfile",
          type=str,
          default=None,
          help="File to save self chat logs",
      )
      parser.add_argument(
          "--save-format",
          type=str,
          default="conversations",
          choices=["conversations", "parlai"],
          help="Format to save logs in. conversations is a jsonl format, parlai is a text format.",
      )
      parser.add_argument(
          "-pmf",
          "--partner-model-file",
          default=None,
          help="Define a different partner for self chat",
      )
      parser.add_argument(
          "--partner-opt-file",
          default=None,
          help="Path to file containing opts to override for partner",
      )
      parser.set_defaults(interactive_mode=True, task="self_chat")
      WorldLogger.add_cmdline_args(parser, partial_opt=None)
      return parser
  
file_path: ParlAI/parlai/scripts/self_chat.py
imports: from parlai.core.params import ParlaiParser
  from parlai.core.agents import create_agent, create_agent_from_model_file
  from parlai.core.worlds import create_task
  from parlai.utils.world_logging import WorldLogger
  from parlai.utils.misc import TimeLogger
  from parlai.core.script import ParlaiScript, register_script
  import parlai.utils.logging
  from parlai.utils.io import PathManager
  import math
  import json
  import random
label_desc: Use image node_id 1 for calling a global function with example usage: setup_args(parser) and returns: parser