code: def aggregate_targets(self, new_batch, context=None):
      if new_batch is None:
          return
      target_vocab = self.tensorizers["trg_seq_tokens"].vocab
      target_pad_token = target_vocab.get_pad_index()
      target_bos_token = target_vocab.get_bos_index()
      target_eos_token = target_vocab.get_eos_index()
  
      cleaned_targets = [
          self._remove_tokens(
              target,
              [target_pad_token, target_eos_token, target_bos_token],
          )
          for target in self._make_simple_list(new_batch[0])
      ]
  
      self.aggregate_data(self.all_targets, cleaned_targets)
      self.aggregate_data(self.all_target_lens, new_batch[1])
  
      target_res = [
          stringify(target, target_vocab) for target in cleaned_targets
      ]
  
      self.aggregate_data(self.all_target_trees, target_res)
  
imports: from collections import defaultdict
  from typing import Dict, List
  import numpy
  import torch
  from pytext.common.constants import BatchContext, DatasetFieldName, Stage
  from pytext.data.tensorizers import Tensorizer
  from pytext.metric_reporters.channel import ConsoleChannel
  from pytext.metric_reporters.seq2seq_compositional import CompositionalSeq2SeqFileChannel, Seq2SeqCompositionalMetricReporter
  from pytext.metric_reporters.seq2seq_metric_reporter import Seq2SeqFileChannel, Seq2SeqMetricReporter
  from pytext.metric_reporters.seq2seq_utils import stringify
  from pytext.metrics import safe_division
  from pytext.metrics.mask_metrics import compute_length_metrics
  from pytext.metrics.seq2seq_metrics import MaskedSeq2SeqTopKMetrics
label_desc: Use image node_id 7 for calling the MaskedSeq2SeqTopKMetricReporter obj's underlying member method code with example usage: obj.aggregate_targets(new_batch, context) without return types