code: def create_agent(game, cuda=True):
      cuda = cuda and torch.cuda.is_available()
  
      model = Connect4Model(game, args)
      if cuda:
          model.cuda()
  
      algorithm = AlphaZero(model)
  
      alphazero_agent = AlphaZeroAgent(algorithm, game, cuda)
      return alphazero_agent
  
file_path: PARL/benchmark/torch/AlphaZero/alphazero_agent.py
imports: import os
  import numpy
  import parl
  import torch
  import torch.optim
  from tqdm import tqdm
  from utils import *
  from connect4_model import Connect4Model
label_desc: Use image node_id 2 for calling a global function with example usage: create_agent(game, cuda) and returns: alphazero_agent