code: def _log_prob_shape(dist, x_size=torch.Size()):
      event_dims = len(dist.event_shape)
      expected_shape = broadcast_shape(
          dist.shape(), x_size, strict=True
      )
      if event_dims > 0:
          expected_shape = expected_shape[:-event_dims]
      return expected_shape
  
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 1 for calling a global function with example usage: _log_prob_shape(dist, x_size) and returns: expected_shape