code: def test_crf_marginals(xseq, yseq, algorithm):
      crf = CRF(algorithm)
      crf.fit([xseq], [yseq])
  
      y_pred_marginals = crf.predict_marginals([xseq])
      assert len(y_pred_marginals) == 1
      marginals = y_pred_marginals[0]
      assert len(marginals) == len(yseq)
  
      labels = crf.tagger_.labels()
      for m in marginals:
          assert isinstance(m, dict)
          assert set(m.keys()) == set(labels)
          assert abs(sum(m.values()) - 1.0) < 1e-6
  
file_path: sklearn-crfsuite/tests/test_crf.py
imports: import os
  import pickle
  import pytest
  from sklearn.model_selection import cross_val_score
  from sklearn_crfsuite import CRF
label_desc: Use image node_id 3 for calling a global function with example usage: test_crf_marginals(xseq, yseq, algorithm) without return types