code: def load_agent_module(agent_path: str):
      """
      Return the module for an agent specified by ``--model``.
  
      Can be formatted in several different ways:
  
      * full: `-m parlai.agents.seq2seq.seq2seq:Seq2seqAgent`
      * shorthand: -m seq2seq, which will check both paths
        ``parlai.agents.seq2seq.seq2seq:Seq2seqAgent`` and
        ``parlai.agents.seq2seq.agents:Seq2seqAgent``
      * half-shorthand: ``-m seq2seq/variant``, which will check the path
        `parlai.agents.seq2seq.variant:VariantAgent`
  
      The base path to search when using shorthand formats can be changed from
      "parlai" to "parlai_internal" by prepending "internal:" to the path, e.g.
      "internal:seq2seq".
  
      To use agents in projects, you can prepend "projects:" and the name of the
      project folder to model arguments, e.g. "projects:personachat:kvmemnn"
      will translate to ``projects/personachat/kvmemnn``.
  
      :param agent_path:
          path to model class in one of the above formats.
  
      :return:
          module of agent
      """
      global AGENT_REGISTRY
      if agent_path in AGENT_REGISTRY:
          return AGENT_REGISTRY[agent_path]
  
      repo, agent_path = assert_get_source_repo(agent_path)
  
      if agent_path.startswith("projects:"):
          # e.g. -m projects:personachat:kvmemnn
          path_list = agent_path.split(":")
          if len(path_list) != 3:
              raise RuntimeError(
                  "projects paths should follow pattern "
                  "projects:folder:model; you used {}"
                  "".format(agent_path)
              )
          folder_name = path_list[1]
          model_name = path_list[2]
          module_name = "projects.{p}.{m}.{m}".format(
              m=model_name, p=folder_name
          )
          class_name = _name_to_agent_class(model_name)
      elif ":" in agent_path:
          # e.g. -m "parlai.agents.seq2seq.seq2seq:Seq2seqAgent"
          path_list = agent_path.split(":")
          module_name = path_list[0]
          class_name = path_list[1]
      elif "/" in agent_path:
          # e.g. -m my_agent/special_variant
          # will check parlai.agents.my_agent.special_variant:SpecialVariantAgent
          path_list = agent_path.split("/")
          module_name = "%s.agents.%s.%s" % (
              repo,
              path_list[0],
              path_list[1],
          )
          class_name = _name_to_agent_class(path_list[1])
      else:
          # e.g. -m seq2seq
          # will check parlai.agents.seq2seq.agents for Seq2seqAgent first
          # then check parlai.agents.seq2seq.seq2seq for Seq2seqAgent second
          class_name = _name_to_agent_class(agent_path)
          try:
              module_name = "%s.agents.%s.agents" % (repo, agent_path)
              importlib.import_module(
                  module_name
              )  # check if it's there
          except ImportError:
              module_name = "%s.agents.%s.%s" % (
                  repo,
                  agent_path,
                  agent_path,
              )
  
      my_module = importlib.import_module(module_name)
      model_class = getattr(my_module, class_name)
  
      return model_class
  
file_path: ParlAI/parlai/core/loader.py
imports: from typing import Callable, Dict, Type, Tuple
  import importlib
  from collections import namedtuple
label_desc: Use image node_id 6 for calling a global function with example usage: load_agent_module(agent_path) and returns: model_class, AGENT_REGISTRY