code: def random_stable(shape, stability, skew=None):
      if skew is None:
          skew = dist.Uniform(-1, 1).sample(shape)
      scale = torch.rand(shape).exp()
      loc = torch.randn(shape)
      return dist.Stable(stability, skew, scale, loc)
  
file_path: pyro/tests/infer/reparam/test_hmm.py
imports: import pytest
  import torch
  import pyro
  import pyro.distributions
  from pyro import poutine
  from pyro.infer.reparam import LinearHMMReparam, StableReparam, StudentTReparam, SymmetricStableReparam
  from tests.common import assert_close
  from tests.ops.gaussian import random_mvn
  from .util import check_init_reparam
label_desc: Use image node_id 2 for calling a global function with example usage: random_stable(shape, stability, skew) and returns: dist