code: def test_change_mapping(self, monkeypatch, rules):
      def mock_load(*args, **kwargs):
          return [
              TextClassificationRecord(text="test", id=i)
              for i in range(5)
          ]
  
      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],
                  [2, 0, -1],
                  [-1, -1, -1],
                  [1, 1, -1],
                  [-1, 0, 2],
              ],
              dtype=np.short,
          )
          annotation_array = np.array([0, 1, -1, 2, 0], dtype=np.short)
          label2int = {
              None: -1,
              "negative": 0,
              "positive": 1,
              "neutral": 2,
          }
          return weak_label_matrix, annotation_array, label2int
  
      monkeypatch.setattr(WeakLabels, "_apply_rules", mock_apply)
  
      weak_labels = WeakLabels(rules=rules, dataset="mock")
  
      with pytest.raises(MissingLabelError):
          weak_labels.change_mapping({"negative": 2})
  
      new_mapping = {
          None: -10,
          "negative": 2,
          "positive": 10,
          "neutral": 1,
      }
  
      old_wlm = weak_labels.matrix().copy()
      old_mapping = weak_labels.label2int.copy()
  
      weak_labels.change_mapping(new_mapping)
  
      assert (
          weak_labels.matrix()
          == np.array(
              [
                  [2, 10, -10],
                  [1, 2, -10],
                  [-10, -10, -10],
                  [10, 10, -10],
                  [-10, 2, 1],
              ],
              dtype=np.short,
          )
      ).all()
      assert (
          weak_labels.annotation(include_missing=True)
          == np.array([2, 10, -10, 1, 2], dtype=np.short)
      ).all()
      assert weak_labels.label2int == new_mapping
      assert weak_labels.int2label == {
          val: key for key, val in new_mapping.items()
      }
  
      weak_labels.change_mapping(old_mapping)
  
      assert (weak_labels.matrix() == old_wlm).all()
  
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 TestWeakLabels obj's underlying member method code with example usage: obj.test_change_mapping(monkeypatch, rules) and returns: unknown, weak_label_matrix,  annotation_array,  label2int