code: def test_from_summaries_weighted_inertia(X, w, probs):
      d = Categorical(probs, inertia=0.5)
      d.summarize(X, sample_weight=w)
      d.from_summaries()
      _test_fit_params(
          d,
          [
              [0.277273, 0.190909, 0.190909, 0.340909],
              [0.240909, 0.413636, 0.195455, 0.15],
              [0.713636, 0.115909, 0.070455, 0.1],
          ],
      )
  
      d = Categorical(probs, inertia=1.0)
      d.summarize(X[:4])
      d.from_summaries()
      _test_fit_params(d, probs)
  
      d.summarize(X[4:])
      d.from_summaries()
      _test_fit_params(d, probs)
  
      d = Categorical(probs, inertia=1.0)
      d.summarize(X)
      d.from_summaries()
      _test_fit_params(d, probs)
  
imports: import os
  import numpy
  import torch
  import pytest
  from pomegranate.distributions import Categorical
  from ._utils import _test_initialization_raises_one_parameter
  from ._utils import _test_predictions
  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 30 for calling a global function with example usage: test_from_summaries_weighted_inertia(X, w, probs) without return types