code: def test_best_epoch():
      mode = "min"
      reporter = Reporter()
      key1 = uuid.uuid4().hex
      stats_list = [{"aa": 0.3}, {"aa": 0.5}, {"aa": 0.2}]
      for e in range(len(stats_list)):
          reporter.set_epoch(e + 1)
          with reporter.observe(key1) as sub:
              sub.register(stats_list[e])
              sub.next()
      best_epoch = reporter.get_best_epoch(key1, "aa", mode)
      assert best_epoch == 3
  
imports: import logging
  import uuid
  from pathlib import Path
  import numpy
  import pytest
  import torch
  from torch.utils.tensorboard import SummaryWriter
  from espnet2.train.reporter import Average, ReportedValue, Reporter, aggregate
label_desc: Use image node_id 7 for calling a global function with example usage: test_best_epoch() without return types