code: def test_reshape_batch(Dist, batch_shape, duration, dim):
      d = random_dist(Dist, batch_shape + (duration, dim))
      d = d.to_event(2 - d.event_dim)
      assert d.batch_shape == batch_shape
      assert d.event_shape == (duration, dim)
  
      actual = reshape_batch(d, batch_shape + (1,))
      assert type(actual) is type(d)
      assert actual.batch_shape == batch_shape + (1,)
      assert actual.event_shape == (duration, dim)
  
file_path: pyro/tests/contrib/forecast/test_util.py
imports: import pytest
  import torch
  from torch.distributions import transform_to
  import pyro.distributions
  from pyro.contrib.forecast.util import UNIVARIATE_DISTS, UNIVARIATE_TRANSFORMS, prefix_condition, reshape_batch
  from tests.ops.gaussian import random_mvn
label_desc: Use image node_id 3 for calling a global function with example usage: test_reshape_batch(Dist, batch_shape, duration, dim) without return types