code: def test_gmm_fit(X, priors):
      X = numpy.array(X) + 1
  
      d1 = Exponential([2.1, 0.3, 0.1])
      d2 = Exponential([1.5, 3.1, 2.2])
      gmm = GeneralMixtureModel([d1, d2], priors=[0.7, 0.3])
      gmm.fit(X)
  
      assert_array_almost_equal(
          gmm._log_priors, [-8.9908e00, -1.2458e-04], 4
      )
      assert_array_almost_equal(d1.scales, [1.7997, 1.7256, 1.5104], 4)
      assert_array_almost_equal(d2.scales, [2.4546, 2.0, 2.091], 4)
  
      d1 = Exponential([2.1, 0.3, 0.1])
      d2 = Exponential([1.5, 3.1, 2.2])
      gmm = GeneralMixtureModel([d1, d2], priors=[0.7, 0.3])
      gmm.fit(X, priors=priors)
  
      assert_array_almost_equal(
          gmm._log_priors, [-1.607879, -0.223534], 4
      )
      assert_array_almost_equal(d1.scales, [1.5753, 2.2913, 1.8507], 4)
      assert_array_almost_equal(d2.scales, [2.6748, 1.927, 2.1511], 4)
  
imports: import os
  import numpy
  import torch
  import pytest
  from pomegranate.gmm import GeneralMixtureModel
  from pomegranate.hmm import DenseHMM
  from pomegranate.distributions import Exponential
  from nose.tools import assert_raises
  from numpy.testing import assert_array_equal
  from numpy.testing import assert_array_almost_equal
label_desc: Use image node_id 20 for calling a global function with example usage: test_gmm_fit(X, priors) without return types