code: def save_agent(
      agent: Agent, agent_name: str, directory: str, separate_dir=True
  ) -> str:
      if separate_dir:
          save_path = os.path.join(directory, agent_name)
          os.makedirs(save_path, exist_ok=True)
      else:
          save_path = directory
  
      checkpoint_path = agent.save(
          directory=save_path, filename=agent_name
      )
      return checkpoint_path
  
imports: import os
  import cv2
  import math
  import random
  import numpy
  import carla
  import pygame
  import threading
  import datetime
  from typing import Union
  from tensorforce.agents import Agent
label_desc: Use image node_id 16 for calling a global function with example usage: save_agent(agent, agent_name, directory, separate_dir) and returns: checkpoint_path