code: def test__initialize_cpe_extra_metrics(self):
      reward_options = RewardOptions(
          metric_reward_values={"metric_a": 2, "metric_b": -2}
      )
      self.metrics_to_score = get_metrics_to_score(
          reward_options.metric_reward_values
      )
      num_output_nodes = (len(self.metrics_to_score) + 1) * len(
          self.params.actions
      )
      reward_network = FullyConnectedDQN(
          state_dim=self.state_dim,
          action_dim=num_output_nodes,
          sizes=self.sizes,
          activations=self.activations,
      )
      q_network_cpe = FullyConnectedDQN(
          state_dim=self.state_dim,
          action_dim=num_output_nodes,
          sizes=self.sizes,
          activations=self.activations,
      )
      q_network_cpe_target = q_network_cpe.get_target_network()
      reward_network = self.reward_network
      q_network_cpe = self.q_network_cpe
      q_network_cpe_target = self.q_network_cpe_target
      optimizer = self.params.optimizer
      # CPE
      trainer = self._construct_trainer()
      trainer._initialize_cpe(
          reward_network, q_network_cpe, q_network_cpe_target, optimizer
      )
      self.assertTrue(
          torch.equal(
              trainer.reward_idx_offsets, torch.tensor([0, 2, 4])
          )
      )
      self.assertIsNotNone(trainer.reward_network)
      self.assertIsNotNone(trainer.q_network_cpe)
      self.assertIsNotNone(trainer.q_network_cpe_target)
      self.assertIsNotNone(trainer.reward_network_optimizer)
      self.assertIsNotNone(trainer.q_network_cpe_optimizer)
      self.assertIsNotNone(trainer.evaluator)
      # no CPE
      trainer = self._construct_trainer(no_cpe=True)
      trainer._initialize_cpe(
          reward_network, q_network_cpe, q_network_cpe_target, optimizer
      )
      self.assertIsNone(trainer.reward_network)
  
imports: import unittest
  from typing import List, Optional, Tuple
  import torch
  from reagent.core.parameters import EvaluationParameters, RLParameters
  from reagent.core.torch_utils import masked_softmax
  from reagent.core.types import DiscreteDqnInput, ExtraData, FeatureData
  from reagent.evaluation.evaluation_data_page import EvaluationDataPage
  from reagent.evaluation.evaluator import get_metrics_to_score
  from reagent.models.dqn import FullyConnectedDQN
  from reagent.training.dqn_trainer_base import DQNTrainerBaseLightning
  from reagent.training.parameters import DQNTrainerParameters
  from reagent.workflow.types import RewardOptions
label_desc: Use image node_id 6 for calling the TestDQNTrainerBaseLightning obj's underlying member method code with example usage: obj.test__initialize_cpe_extra_metrics() without return types