code: def test_score(self, monkeypatch, weak_labels, policy, expected):
      def mock_predict(self, L, return_probs, tie_break_policy):
          assert (L == weak_labels.matrix(has_annotation=True)).all()
          assert return_probs is True
          assert tie_break_policy == policy
          if policy == "abstain":
              predictions = np.array([-1, 1, 0])
          elif policy == "random":
              predictions = np.array([0, 1, 0])
          else:
              raise ValueError("Untested policy!")
  
          probabilities = None  # accuracy does not need probabs ...
  
          return predictions, probabilities
  
      monkeypatch.setattr(
          "snorkel.labeling.model.LabelModel.predict",
          mock_predict,
      )
  
      label_model = Snorkel(weak_labels)
      metrics = label_model.score(tie_break_policy=policy)
  
      assert metrics["accuracy"] == pytest.approx(expected)
      assert list(metrics.keys())[:3] == [
          "negative",
          "positive",
          "neutral",
      ]
  
imports: import sys
  import numpy
  import pytest
  from argilla.client.models import TextClassificationRecord
  from argilla.labeling.text_classification import FlyingSquid, Snorkel, WeakLabels, WeakMultiLabels
  from argilla.labeling.text_classification.label_models import LabelModel, MajorityVoter, MissingAnnotationError, NotFittedError, TieBreakPolicy, TooFewRulesError
label_desc: Use image node_id 7 for calling the TestSnorkel obj's underlying member method code with example usage: obj.test_score(monkeypatch, weak_labels, policy, expected) and returns: predictions,  probabilities