code: def display_data(opt):
      # force ordered data to prevent repeats
      if (
          "ordered" not in opt["datatype"]
          and "train" in opt["datatype"]
      ):
          opt["datatype"] = f"{opt['datatype']}:ordered"
  
      # create dummy agent and assign it to the specified task
      opt.log()
      opt["fixed_response"] = None
      agent = FixedResponseAgent(opt)
      world = create_task(opt, agent)
  
      # Show some example dialogs.
      turn = 0
      for _ in range(opt["num_examples"]):
          world.parley()
  
          # NOTE: If you want to look at the data from here rather than calling
          # world.display() you could access world.acts[0] directly, see simple_display above.
          if opt.get("verbose", False) or opt.get(
              "display_add_fields", ""
          ):
              print(
                  world.display()
                  .encode("utf-16", "surrogatepass")
                  .decode("utf-16")
                  + "\n~~"
              )
          else:
              simple_display(opt, world, turn)
              turn += 1
              if world.get_acts()[0]["episode_done"]:
                  turn = 0
  
          if world.epoch_done():
              logging.info("epoch done")
              break
  
      try:
          # print dataset size if available
          logging.info(
              f"loaded {world.num_episodes()} episodes with a "
              f"total of {world.num_examples()} examples"
          )
      except Exception:
          pass
  
file_path: ParlAI/parlai/scripts/display_data.py
imports: from parlai.core.params import ParlaiParser
  from parlai.agents.fixed_response.fixed_response import FixedResponseAgent
  from parlai.core.worlds import create_task
  from parlai.utils.strings import colorize
  from parlai.core.script import ParlaiScript, register_script
  import parlai.utils.logging
  import random
label_desc: Use image node_id 3 for calling a global function with example usage: display_data(opt) without return types