code: def test_summarize(X, means, covs):
      for m, c in ((means, covs), (None, None)):
          d = Normal(m, c, covariance_type="full")
          d.summarize(X[:4])
          assert_array_almost_equal(d._w_sum, [4.0, 4.0, 4.0])
          assert_array_almost_equal(d._xw_sum, [6.1, 5.5, 6.2])
          assert_array_almost_equal(
              d._xxw_sum,
              [
                  [13.03, 10.459999, 11.1],
                  [10.459999, 10.07, 8.35],
                  [11.1, 8.35, 11.620001],
              ],
              4,
          )
  
          d.summarize(X[4:])
          assert_array_almost_equal(d._w_sum, [7.0, 7.0, 7.0])
          assert_array_almost_equal(d._xw_sum, [17.1, 9.7, 10.6])
          assert_array_almost_equal(
              d._xxw_sum,
              [
                  [58.59, 26.98, 33.940002],
                  [26.98, 16.369999, 16.380001],
                  [33.940002, 16.380001, 27.720001],
              ],
              4,
          )
  
          d = Normal(m, c, covariance_type="full")
          d.summarize(X)
          assert_array_almost_equal(d._w_sum, [7.0, 7.0, 7.0])
          assert_array_almost_equal(
              d._xw_sum, [17.099998, 9.7, 10.599999]
          )
          assert_array_almost_equal(
              d._xxw_sum,
              [
                  [58.59, 26.98, 33.940002],
                  [26.98, 16.369999, 16.38],
                  [33.940002, 16.38, 27.720001],
              ],
              4,
          )
  
imports: import os
  import numpy
  import torch
  import pytest
  from pomegranate.distributions import Normal
  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 17 for calling a global function with example usage: test_summarize(X, means, covs) without return types