code: def test_draw_matheron_paths(self):
      for seed, model in enumerate(
          (
              self.inferred_noise_gp,
              self.observed_noise_gp,
              self.variational_gp,
          )
      ):
          for sample_shape in [Size([1024]), Size([32, 32])]:
              torch.random.manual_seed(seed)
              paths = draw_matheron_paths(
                  model=model, sample_shape=sample_shape
              )
              self.assertIsInstance(paths, MatheronPath)
              self._test_draw_matheron_paths(model, paths, sample_shape)
  
      with self.subTest("test_model_list"):
          model_list = ModelListGP(
              self.inferred_noise_gp, self.observed_noise_gp
          )
          path_list = draw_matheron_paths(
              model_list, sample_shape=sample_shape
          )
          (train_X,) = get_train_inputs(
              model_list.models[0], transformed=False
          )
          X = torch.zeros(
              4,
              train_X.shape[-1],
              dtype=train_X.dtype,
              device=self.device,
          )
          sample_list = path_list(X)
          self.assertIsInstance(path_list, PathList)
          self.assertIsInstance(sample_list, list)
          self.assertEqual(len(sample_list), len(path_list.paths))
  
file_path: botorch/test/sampling/pathwise/test_posterior_samplers.py
imports: from __future__ import annotations
  from copy import deepcopy
  import torch
  from botorch.models import ModelListGP, SingleTaskGP, SingleTaskVariationalGP
  from botorch.models.transforms.input import Normalize
  from botorch.models.transforms.outcome import Standardize
  from botorch.sampling.pathwise import draw_matheron_paths, MatheronPath, PathList
  from botorch.sampling.pathwise.utils import get_train_inputs
  from botorch.utils.test_helpers import get_sample_moments, standardize_moments
  from botorch.utils.testing import BotorchTestCase
  from gpytorch.kernels import MaternKernel, ScaleKernel
  from torch import Size
  from torch.nn.functional import pad
label_desc: Use image node_id 2 for calling the TestPosteriorSamplers obj's underlying member method code with example usage: obj.test_draw_matheron_paths() without return types