code: def test_sample(shapes, rates):
      torch.manual_seed(0)
  
      X = Gamma(shapes, rates).sample(1)
      assert_array_almost_equal(X, [[10.794655, 0.367495, 0.568067]])
  
      X = Gamma(shapes, rates).sample(5)
      assert_array_almost_equal(
          X,
          [
              [0.3594, 0.2441, 1.0691],
              [0.9625, 1.0465, 0.9298],
              [4.2083, 0.6331, 3.7465],
              [3.5261, 1.1585, 1.4492],
              [1.1837, 0.5522, 2.1590],
          ],
          3,
      )
  
imports: import os
  import numpy
  import torch
  import pytest
  from pomegranate.distributions import Gamma
  from ._utils import _test_initialization_raises_two_parameters
  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 14 for calling a global function with example usage: test_sample(shapes, rates) without return types