code: def get_agent(**kwargs):
      r"""
      Return opt-initialized agent.
  
      :param kwargs: any kwargs you want to set using parser.set_params(\*\*kwargs)
      """
      if "no_cuda" not in kwargs:
          kwargs["no_cuda"] = True
      from parlai.core.params import ParlaiParser
  
      parser = ParlaiParser()
      MockTorchAgent.add_cmdline_args(parser, partial_opt=None)
      parser.set_params(**kwargs)
      opt = parser.parse_args([])
      return MockTorchAgent(opt)
  
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 1 for calling a global function with example usage: get_agent() and returns: MockTorchAgent