code: def test_history_partial_and_full_index_batches(self, history, ref):
      loss_with_extra = history[
          :, "batches", :, ("loss", "extra_batch")
      ]
  
      expected_e0 = [
          (b["loss"], b["extra_batch"])
          for b in ref[0]["batches"]
          if "extra_batch" in b
      ]
      expected_e1 = [
          (b["loss"], b["extra_batch"])
          for b in ref[1]["batches"]
          if "extra_batch" in b
      ]
  
      assert len(loss_with_extra) == self.test_epochs - 1
      assert loss_with_extra[0] == expected_e0
      assert loss_with_extra[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 17 for calling the TestHistory obj's underlying member method code with example usage: obj.test_history_partial_and_full_index_batches(history, ref) without return types