code: def test_sample_2(alpha, beta):
      num_samples = 10000
  
      d = dist.Stable(alpha, beta, coords="S")
      # Temporarily increase radius to test hole-patching logic.
      # Scipy doesn't handle values of alpha very close to 1.
      try:
          old = pyro.distributions.stable.RADIUS
          pyro.distributions.stable.RADIUS = 0.02
          actual = d.sample([num_samples])
      finally:
          pyro.distributions.stable.RADIUS = old
      actual = d.sample([num_samples])
  
      expected = levy_stable.rvs(alpha, beta, size=num_samples)
  
      assert ks_2samp(expected, actual).pvalue > 0.05
  
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 3 for calling a global function with example usage: test_sample_2(alpha, beta) without return types