code: def test_history_multiple_keys(self, history, type_):
      dur_loss = history[-1, type_(["duration", "total_loss"])]
      # pylint: disable=unidiomatic-typecheck
      assert type(dur_loss) is type_ and len(dur_loss) == 2
  
      loss_loss = history[-1, "batches", -1, type_(["loss", "loss"])]
      # pylint: disable=unidiomatic-typecheck
      assert type(loss_loss) is type_ and len(loss_loss) == 2
  
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 26 for calling the TestHistory obj's underlying member method code with example usage: obj.test_history_multiple_keys(history, type_) without return types