class_docstr: Base Agent class handling the interaction with the environment.
  
  >>> env = gym.make("CartPole-v1")
  >>> buffer = ReplayBuffer(10)
  >>> Agent(env, buffer)  # doctest: +ELLIPSIS
  <...reinforce_learn_Qnet.Agent object at ...>
docstr: Using the given network, decide what action to carry out using an epsilon-greedy policy.
  
  Args:
      net: DQN network
      epsilon: value to determine likelihood of taking a random action
      device: current device
  
  Returns:
      action
docstr_tok: ["Using","the","given","network",",","decide","what","action","to","carry","out","using","an","epsilon-greedy","policy",".","Args",":","net",":","DQN","network","epsilon",":","value","to","determine","likelihood","of","taking","a","random","action","device",":","current","device","Returns",":","action"]
code: def get_action(
      self, net: nn.Module, epsilon: float, device: str
  ) -> int:
      """Using the given network, decide what action to carry out using an epsilon-greedy policy.
  
      Args:
          net: DQN network
          epsilon: value to determine likelihood of taking a random action
          device: current device
  
      Returns:
          action
  
      """
      if np.random.random() < epsilon:
          action = self.env.action_space.sample()
      else:
          state = torch.tensor([self.state])
  
          if device not in ["cpu"]:
              state = state.cuda(device)
  
          q_values = net(state)
          _, action = torch.max(q_values, dim=1)
          action = int(action.item())
  
      return action
  
imports: import argparse
  from collections import OrderedDict, deque, namedtuple
  from typing import Iterator, List, Tuple
  import gym
  import numpy
  import torch
  import torch.nn
  import torch.optim
  from lightning.pytorch import LightningModule, Trainer, cli_lightning_logo, seed_everything
  from torch.optim.optimizer import Optimizer
  from torch.utils.data import DataLoader
  from torch.utils.data.dataset import IterableDataset
label_desc: Use image node_id 3 for calling the Agent obj's underlying member method code with example usage: obj.get_action(net, epsilon, device) and returns: action