code: def _is_multivariate(d):
      while isinstance(d, (Independent, MaskedDistribution)):
          d = d.base_dist
      return any(size > 1 for size in d.event_shape)
  
imports: import functools
  from typing import Callable, Optional
  import torch
  from torch.distributions import transform_to
  from pyro.distributions.torch import Independent
  from pyro.distributions.torch_distribution import MaskedDistribution
  from pyro.infer.util import is_validation_enabled
  from pyro.poutine.messenger import Messenger
  from pyro.util import torch_isnan
  from .utils import helpful_support_errors
label_desc: Use image node_id 1 for calling a global function with example usage: _is_multivariate(d) and returns: any