code: def test_summarize_weighted_2d(X):
      d = Normal(covariance_type="full")
      d.summarize(X[:4], sample_weight=X[:4])
      assert_array_almost_equal(d._w_sum, [6.1, 5.5, 6.2])
      assert_array_almost_equal(d._xw_sum, [13.03, 10.069999, 11.62])
      assert_array_almost_equal(
          d._xxw_sum,
          [
              [33.990997, 24.928, 26.383999],
              [20.235998, 19.860996, 14.620998],
              [22.9, 16.351, 23.618],
          ],
          5,
      )
  
      d.summarize(X[4:], sample_weight=X[4:])
      assert_array_almost_equal(d._w_sum, [17.1, 9.7, 10.6])
      assert_array_almost_equal(
          d._xw_sum, [58.59, 16.369999, 27.720001]
      )
      assert_array_almost_equal(
          d._xxw_sum,
          [
              [241.40701, 98.18401, 146.97601],
              [46.848, 29.917, 29.53],
              [109.62801, 46.854, 87.646],
          ],
          5,
      )
  
      d = Normal(covariance_type="full")
      d.summarize(X, sample_weight=X)
      assert_array_almost_equal(d._w_sum, [17.099998, 9.7, 10.599999])
      assert_array_almost_equal(
          d._xw_sum, [58.59, 16.369999, 27.720001]
      )
      assert_array_almost_equal(
          d._xxw_sum,
          [
              [241.40701, 98.18401, 146.97601],
              [46.848, 29.917, 29.53],
              [109.62801, 46.854, 87.646],
          ],
          5,
      )
  
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 20 for calling a global function with example usage: test_summarize_weighted_2d(X) without return types