class_docstr: PyTorch Lightning implementation of PPO.
  
  Example:
      model = PPOLightning("CartPole-v0")
  Train:
      trainer = Trainer()
      trainer.fit(model)
docstr: Calculate the advantage given rewards, state values, and the last value of episode.
  
  Args:
      rewards: list of episode rewards
      values: list of state values from critic
      last_value: value of last state of episode
  
  Returns:
      list of advantages
code: def calc_advantage(
      self, rewards: List[float], values: List[float], last_value: float
  ) -> List[float]:
      """Calculate the advantage given rewards, state values, and the last value of episode.
  
      Args:
          rewards: list of episode rewards
          values: list of state values from critic
          last_value: value of last state of episode
  
      Returns:
          list of advantages
  
      """
      rews = rewards + [last_value]
      vals = values + [last_value]
      # GAE
      delta = [
          rews[i] + self.gamma * vals[i + 1] - vals[i]
          for i in range(len(rews) - 1)
      ]
      return self.discount_rewards(delta, self.gamma * self.lam)
  
imports: import argparse
  from typing import Callable, Iterator, List, Tuple
  import gym
  import torch
  from lightning.pytorch import LightningModule, Trainer, cli_lightning_logo, seed_everything
  from torch import nn
  from torch.distributions import Categorical, Normal
  from torch.optim.optimizer import Optimizer
  from torch.utils.data import DataLoader, IterableDataset
label_desc: Use image node_id 4 for calling the PPOLightning obj's underlying member method code with example usage: obj.calc_advantage(rewards, values, last_value) and returns: self