code: def test_matrix_annotation_properties(self, monkeypatch):
      expected_records = [
          TextClassificationRecord(text="test without annot"),
          TextClassificationRecord(
              text="test with annot", annotation="positive"
          ),
      ]
  
      def mock_load(*args, **kwargs):
          return expected_records
  
      monkeypatch.setattr(
          "argilla.labeling.text_classification.weak_labels.load",
          mock_load,
      )
  
      def mock_apply(self, *args, **kwargs):
          weak_label_matrix = np.array(
              [[0, 1], [-1, 0]], dtype=np.short
          )
          annotation_array = np.array([-1, 0], dtype=np.short)
          label2int = {None: -1, "negative": 0, "positive": 1}
          return weak_label_matrix, annotation_array, label2int
  
      monkeypatch.setattr(WeakLabels, "_apply_rules", mock_apply)
  
      weak_labels = WeakLabels(
          rules=[lambda x: "mock"] * 2, dataset="mock"
      )
  
      assert (
          weak_labels.matrix(has_annotation=False)
          == np.array([[0, 1]], dtype=np.short)
      ).all()
      assert (
          weak_labels.matrix(has_annotation=True)
          == np.array([[-1, 0]], dtype=np.short)
      ).all()
      assert (
          weak_labels.annotation() == np.array([[0]], dtype=np.short)
      ).all()
      assert (
          weak_labels.annotation(include_missing=True)
          == np.array([[-1, 0]], dtype=np.short)
      ).all()
      with pytest.warns(
          FutureWarning,
          match="'exclude_missing_annotations' is deprecated",
      ):
          weak_labels.annotation(exclude_missing_annotations=True)
  
imports: import sys
  from typing import Callable, List, Optional, Union
  import numpy
  import pandas
  import pytest
  from argilla.client.models import TextClassificationRecord
  from argilla.client.sdk.text_classification.models import CreationTextClassificationRecord, TextClassificationBulkData
  from argilla.labeling.text_classification import WeakLabels, WeakMultiLabels
  from argilla.labeling.text_classification.rule import Rule
  from argilla.labeling.text_classification.weak_labels import DuplicatedRuleNameError, MissingLabelError, MultiLabelError, NoRecordsFoundError, NoRulesFoundError, WeakLabelsBase
  from argilla.server.commons.models import TaskType
  from pandas.testing import assert_frame_equal
  from tests.integration.helpers import SecuredClient
label_desc: Use image node_id 4 for calling the TestWeakLabels obj's underlying member method code with example usage: obj.test_matrix_annotation_properties(monkeypatch) and returns: expected_records, weak_label_matrix,  annotation_array,  label2int