code: def get_model_name(opt):
      """
      Get the model name from either `--model` or `--model-file`.
      """
      model = opt.get("model", None)
      if model is None:
          # try to get model name from model opt file
          model_file = opt.get("model_file", None)
          if model_file is not None:
              model_file = modelzoo_path(
                  opt.get("datapath"), model_file
              )
              optfile = model_file + ".opt"
              if PathManager.exists(optfile):
                  new_opt = Opt.load(optfile)
                  model = new_opt.get("model", None)
      return model
  
imports: import argparse
  import importlib
  import os
  import sys
  import datetime
  import parlai
  import parlai.utils.logging
  from parlai.core.build_data import modelzoo_path
  from parlai.core.loader import load_teacher_module, load_agent_module, load_world_module
  from parlai.tasks.tasks import ids_to_tasks
  from parlai.core.opt import Opt
  from parlai.utils.io import PathManager
  from typing import List, Optional
label_desc: Use image node_id 3 for calling a global function with example usage: get_model_name(opt) and returns: model