code: def test_make_single_label_records(
      self, weak_labels, include_abstentions, tie_break_policy, expected
  ):
      mj = MajorityVoter(weak_labels)
      probs = mj._compute_single_label_probs(weak_labels.matrix())
  
      records = mj._make_single_label_records(
          probs,
          weak_labels.records(),
          include_abstentions,
          prediction_agent="mock",
          tie_break_policy=tie_break_policy,
      )
  
      assert records[-1].prediction_agent == "mock"
      assert records[-1].prediction == [
          ("neutral", 2.0 / 3),
          ("negative", 1.0 / 3),
          ("positive", 0.0),
      ]
      assert len(records) == expected
      if (
          include_abstentions
          and tie_break_policy is TieBreakPolicy.ABSTAIN
      ):
          assert all(rec.prediction is None for rec in records[:3])
      if tie_break_policy is TieBreakPolicy.RANDOM:
          assert records[2].prediction == [
              ("negative", 1.0 / 3 + 0.0001),
              ("neutral", 1.0 / 3 - 0.00005),
              ("positive", 1.0 / 3 - 0.00005),
          ]
  
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 4 for calling the TestMajorityVoter obj's underlying member method code with example usage: obj.test_make_single_label_records(weak_labels, include_abstentions, tie_break_policy, expected) without return types