code: def test_get_train_targets(self):
      for model in self.models:
          model.train()
          if isinstance(model, SingleTaskVariationalGP):
              F = model.model.train_targets
              Y = model.outcome_transform.untransform(F)[0].squeeze(
                  dim=0
              )
          else:
              F = model.train_targets
              Y = OutcomeUntransformer(
                  model.outcome_transform, model.num_outputs
              )(F)
  
          self.assertTrue(
              F.equal(get_train_targets(model, transformed=True))
          )
          self.assertTrue(
              Y.equal(get_train_targets(model, transformed=False))
          )
  
          model.eval()
          self.assertTrue(
              F.equal(get_train_targets(model, transformed=True))
          )
          self.assertTrue(
              Y.equal(get_train_targets(model, transformed=False))
          )
          with delattr_ctx(model, "outcome_transform"):
              self.assertTrue(
                  F.equal(get_train_targets(model, transformed=True))
              )
              self.assertTrue(
                  F.equal(get_train_targets(model, transformed=False))
              )
  
      with self.subTest("test_model_list"):
          model_list = ModelListGP(*self.models)
          target_list = get_train_targets(model_list)
          self.assertIsInstance(target_list, list)
          self.assertEqual(len(target_list), len(self.models))
          for model, Y in zip(self.models, target_list):
              self.assertTrue(Y.equal(get_train_targets(model)))
  
imports: from __future__ import annotations
  from unittest.mock import patch
  import torch
  from botorch.models import SingleTaskGP, SingleTaskVariationalGP
  from botorch.models.model_list_gp_regression import ModelListGP
  from botorch.models.transforms.input import Normalize
  from botorch.models.transforms.outcome import Standardize
  from botorch.sampling.pathwise.utils import get_input_transform, get_output_transform, get_train_inputs, get_train_targets, InverseLengthscaleTransform, OutcomeUntransformer
  from botorch.utils.context_managers import delattr_ctx
  from botorch.utils.testing import BotorchTestCase
  from gpytorch.kernels import MaternKernel, ScaleKernel
label_desc: Use image node_id 5 for calling the TestGetters obj's underlying member method code with example usage: obj.test_get_train_targets() without return types