code: def check_sample_shapes(small, large):
      dist_instance = small
      if isinstance(
          dist_instance,
          (
              dist.LogNormal,
              dist.LowRankMultivariateNormal,
              dist.VonMises,
              dist.LogNormalNegativeBinomial,
          ),
      ):
          # Ignore broadcasting bug in LogNormal:
          # https://github.com/pytorch/pytorch/pull/7269
          # LogNormalNegativeBinomial has no sample method
          return
      x = small.sample()
      assert_equal(
          small.log_prob(x).expand(large.batch_shape), large.log_prob(x)
      )
      x = large.sample()
      assert_equal(small.log_prob(x), large.log_prob(x))
  
imports: import numpy
  import pytest
  import torch
  import pyro
  import pyro.distributions
  from pyro.distributions import TorchDistribution
  from pyro.distributions.testing.gof import auto_goodness_of_fit
  from pyro.distributions.util import broadcast_shape
  from tests.common import TEST_FAILURE_RATE, assert_close, assert_equal, xfail_if_not_implemented
label_desc: Use image node_id 18 for calling a global function with example usage: check_sample_shapes(small, large) without return types