code: def test_broadcast(
      mask_shape, component0_shape, component1_shape, value_shape
  ):
      mask = torch.empty(torch.Size(mask_shape)).bernoulli_(0.5).bool()
      component0 = dist.Normal(torch.zeros(component0_shape), 1.0)
      component1 = dist.Exponential(torch.ones(component1_shape))
      value = torch.ones(value_shape)
  
      d = dist.MaskedMixture(mask, component0, component1)
      d_shape = broadcast_shape(
          mask_shape, component0_shape, component1_shape
      )
      assert d.batch_shape == d_shape
  
      log_prob_shape = broadcast_shape(d_shape, value_shape)
      assert d.log_prob(value).shape == log_prob_shape
  
file_path: pyro/tests/distributions/test_mixture.py
imports: import pytest
  import torch
  import pyro.distributions
  from pyro.distributions.util import broadcast_shape
  from pyro.util import torch_isnan
  from tests.common import assert_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_broadcast(mask_shape, component0_shape, component1_shape, value_shape) without return types