code: def learn(self, state, action, reward, next_state, done):
      
      self.steps += 1
      self.replay.append((state, action, reward, next_state, done))
      if self.steps > self.min_steps and len(self.replay) > self.batch_size:
        batch = random.sample(self.replay, self.batch_size)
        return self.optimize(batch)
  
      return None
docs: Update replay memory and learn from a batch of random experiences sampled
      from the replay buffer
      :return: optimization loss if enough experiences are available, None otherwise