code: def test_dist_to_funsor_independent(batch_shape, event_shape):
      loc = torch.randn(batch_shape + event_shape)
      scale = torch.randn(batch_shape + event_shape).exp()
      d = dist.Normal(loc, scale).to_event(len(event_shape))
      f = dist_to_funsor(d)
      assert isinstance(f, Funsor)
  
      value = d.sample()
      funsor_value = tensor_to_funsor(
          value, event_output=len(event_shape)
      )
      actual_log_prob = f(value=funsor_value)
      expected_log_prob = tensor_to_funsor(d.log_prob(value))
      assert_close(actual_log_prob, expected_log_prob, rtol=1e-5)
  
imports: from collections import OrderedDict
  import pyro.distributions
  import pytest
  import torch
  from pyro.distributions.torch_distribution import MaskedDistribution
  from funsor.domains import Bint, Reals
  from funsor.pyro.convert import dist_to_funsor, funsor_to_cat_and_mvn, funsor_to_mvn, funsor_to_tensor, matrix_and_mvn_to_funsor, mvn_to_funsor, tensor_to_funsor
  from funsor.tensor import Tensor
  from funsor.terms import Funsor
  from funsor.testing import assert_close, random_mvn
label_desc: Use image node_id 11 for calling a global function with example usage: test_dist_to_funsor_independent(batch_shape, event_shape) without return types