code: def test_extend_matrix(self, weak_multi_labels):
      with pytest.raises(
          ValueError,
          match="Embeddings are not optional the first time a matrix is extended.",
      ):
          weak_multi_labels.extend_matrix([1.0, 0.5, 0.5])
  
      weak_multi_labels.extend_matrix(
          [1.0, 0.5, 0.5],
          np.array([[0.1, 0.1], [0.1, 0.11], [0.11, 0.1]]),
      )
  
      np.testing.assert_equal(
          weak_multi_labels.matrix(),
          np.array(
              [
                  [[0, 1], [1, 1], [-1, -1]],
                  [[-1, -1], [1, 1], [-1, -1]],
                  [[-1, -1], [1, 1], [-1, -1]],
              ]
          ),
      )
  
      expected_summary = pd.DataFrame(
          {
              "label": [
                  {"mock2"},
                  {"mock2", "mock1"},
                  set(),
                  {"mock2", "mock1"},
              ],
              "coverage": [1 / 3.0, 1.0, 0.0, 1.0],
              "annotated_coverage": [0.5, 1.0, 0.0, 1.0],
              "overlaps": [1 / 3.0, 1 / 3.0, 0.0, 1 / 3.0],
              "correct": [0, 2, 0, 2],
              "incorrect": [1, 2, 0, 3],
              "precision": [0, 0.5, np.nan, 2 / 5.0],
          },
          index=list(weak_multi_labels._rules_name2index.keys())
          + ["total"],
      )
      # The "correct" and "incorrect" columns from `expected_summary` may infer a different
      # dtype than `weak_multi_labels.summary()` returns.
      assert_frame_equal(
          weak_multi_labels.summary(),
          expected_summary,
          check_dtype=False,
      )
  
      expected_show_records = pd.DataFrame(
          map(lambda x: x.dict(), weak_multi_labels.records())
      )
      assert_frame_equal(
          weak_multi_labels.show_records(rules=["rule_1"]),
          expected_show_records,
      )
  
      weak_multi_labels.extend_matrix([1.0, 1.0, 1.0])
  
      np.testing.assert_equal(
          weak_multi_labels.matrix(),
          np.array(
              [
                  [[0, 1], [-1, -1], [-1, -1]],
                  [[-1, -1], [1, 1], [-1, -1]],
                  [[-1, -1], [-1, -1], [-1, -1]],
              ]
          ),
      )
  
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 7 for calling the TestWeakMultiLabels obj's underlying member method code with example usage: obj.test_extend_matrix(weak_multi_labels) without return types