class_docstr: Tests for early stopping logic.
class_docstr_tok: ["Tests","for","early","stopping","logic","."]
docstr: Test report_result API.
docstr_tok: ["Test","report_result","API","."]
code: def test_report_result(self):
      """Test report_result API."""
      metric = 1.0e-03
      epoch = 3
      stop = self.instance.report_result(metric=metric, epoch=epoch)
      assert isinstance(stop, bool)
  
      # assert that reporting another metric for this epoch raises an error
      with self.assertRaises(ValueError):
          self.instance.report_result(metric=..., epoch=epoch)
  
imports: import unittest
  from typing import List
  import numpy
  import pytest
  import torch
  import unittest_templates
  from torch.optim import Adam
  from pykeen.datasets import Nations
  from pykeen.evaluation import RankBasedEvaluator
  from pykeen.models import Model, TransE
  from pykeen.stoppers.early_stopping import EarlyStopper, EarlyStoppingLogic, is_improvement
  from pykeen.training import SLCWATrainingLoop
  from tests import cases
label_desc: Use image node_id 1 for calling the TestEarlyStoppingLogic obj's underlying member method code with example usage: obj.test_report_result() without return types