code: def test_history_partial_batches_batch_key_4th(self, history, ref):
      extra_batches = history[:, "batches", :, "extra_batch"]
  
      expected_e0 = [
          b["extra_batch"]
          for b in ref[0]["batches"]
          if "extra_batch" in b
      ]
      expected_e1 = [
          b["extra_batch"]
          for b in ref[1]["batches"]
          if "extra_batch" in b
      ]
  
      # In every epoch there are 2 batches with the 'extra_batch'
      # key except for the last epoch. We therefore two results
      # of which one of them is an empty list.
      assert len(extra_batches) == self.test_epochs - 1
      assert extra_batches[0] == expected_e0
      assert extra_batches[1] == expected_e1
  
imports: import pickle
  import time
  import multiprocessing
  from functools import partial
  import numpy
  import pytest
  import torch
  from torch.distributed import TCPStore
  from sklearn.datasets import make_classification
label_desc: Use image node_id 19 for calling the TestHistory obj's underlying member method code with example usage: obj.test_history_partial_batches_batch_key_4th(history, ref) without return types