code: def reload_agent(self, agent: BaseAgent, agent_class_file):
          
          self.logger.debug('Reloading Agent: ' + agent_class_file)
          self.agent_class_wrapper.reload()
          old_agent = agent
          agent, agent_class_file = self.load_agent()
  
          # Retire after the replacement initialized properly.
          if hasattr(old_agent, 'retire'):
              old_agent.retire()
  
          return agent, agent_class_file
docs: Reloads the agent. Can throw exceptions. External classes should use reload_event.set() instead.
          :param agent: An instance of an agent.
          :param agent_class_file: The agent's class file. TODO: Remove this argument, it only affects logging and may be misleading.
          :return: The reloaded instance of the agent, and the agent class file.