class_docstr: PyTorch Lightning implementation of PPO.
  
  Example:
      model = PPOLightning("CartPole-v0")
  Train:
      trainer = Trainer()
      trainer.fit(model)
docstr: Calculate the discounted rewards of all rewards in list.
  
  Args:
      rewards: list of rewards/advantages
  
  Returns:
      list of discounted rewards/advantages
code: def discount_rewards(
      self, rewards: List[float], discount: float
  ) -> List[float]:
      """Calculate the discounted rewards of all rewards in list.
  
      Args:
          rewards: list of rewards/advantages
  
      Returns:
          list of discounted rewards/advantages
  
      """
      assert isinstance(rewards[0], float)
  
      cumul_reward = []
      sum_r = 0.0
  
      for r in reversed(rewards):
          sum_r = (sum_r * discount) + r
          cumul_reward.append(sum_r)
  
      return list(reversed(cumul_reward))
  
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 3 for calling the PPOLightning obj's underlying member method code with example usage: obj.discount_rewards(rewards, discount) and returns: list