code: def extract_batch_covar(
      mt_mvn: MultitaskMultivariateNormal,
  ) -> LinearOperator:
      r"""Extract a batched independent covariance matrix from an MTMVN.
  
      Args:
          mt_mvn: A multi-task multivariate normal with a block diagonal
              covariance matrix.
  
      Returns:
          A lazy covariance matrix consisting of a batch of the blocks of
              the diagonal of the MultitaskMultivariateNormal.
  
      """
      lazy_covar = mt_mvn.lazy_covariance_matrix
      if not isinstance(lazy_covar, BlockDiagLinearOperator):
          raise BotorchError(
              f"Expected BlockDiagLinearOperator, but got {type(lazy_covar)}."
          )
      return lazy_covar.base_linear_op
  
file_path: botorch/botorch/utils/low_rank.py
imports: from __future__ import annotations
  import torch
  from botorch.exceptions.errors import BotorchError
  from botorch.posteriors.base_samples import _reshape_base_samples_non_interleaved
  from botorch.posteriors.gpytorch import GPyTorchPosterior
  from gpytorch.distributions.multitask_multivariate_normal import MultitaskMultivariateNormal
  from linear_operator.operators import BlockDiagLinearOperator, LinearOperator
  from linear_operator.utils.cholesky import psd_safe_cholesky
  from linear_operator.utils.errors import NanError
  from torch import Tensor
label_desc: Use image node_id 1 for calling a global function with example usage: extract_batch_covar(mt_mvn) and returns: lazy_covar