code: def test_sample(scales):
      torch.manual_seed(0)
  
      X = Exponential(scales).sample(1)
      assert_array_almost_equal(X, [[4.209991, 2.214692, 1.291593]])
  
      X = Exponential(scales).sample(5)
      assert_array_almost_equal(
          X,
          [
              [3.0421, 1.8643, 3.2889],
              [0.2361, 0.7785, 1.8285],
              [0.4080, 1.0855, 0.4086],
              [0.5267, 1.7507, 1.3807],
              [0.6975, 0.9415, 0.4829],
          ],
          3,
      )
  
imports: import os
  import numpy
  import torch
  import pytest
  from pomegranate.distributions import Exponential
  from ._utils import _test_initialization_raises_one_parameter
  from ._utils import _test_initialization
  from ._utils import _test_predictions
  from ._utils import _test_efd_from_summaries
  from ._utils import _test_raises
  from nose.tools import assert_raises
  from numpy.testing import assert_array_almost_equal
label_desc: Use image node_id 13 for calling a global function with example usage: test_sample(scales) without return types