code: def test_shape(sample_shape, batch_shape):
      stability = (
          torch.empty(batch_shape).uniform_(0, 2).requires_grad_()
      )
      skew = torch.empty(batch_shape).uniform_(-1, 1).requires_grad_()
      scale = torch.randn(batch_shape).exp().requires_grad_()
      loc = torch.randn(batch_shape).requires_grad_()
  
      d = dist.Stable(stability, skew, scale, loc)
      assert d.batch_shape == batch_shape
  
      x = d.rsample(sample_shape)
      assert x.shape == sample_shape + batch_shape
  
      x.sum().backward()
  
file_path: pyro/tests/distributions/test_stable.py
imports: import warnings
  import pytest
  import torch
  from scipy.integrate.quadpack import IntegrationWarning
  from scipy.stats import ks_2samp, kstest, levy_stable
  import pyro.distributions
  import pyro.distributions.stable
  from tests.common import assert_close
label_desc: Use image node_id 1 for calling a global function with example usage: test_shape(sample_shape, batch_shape) without return types