code: def test_sort_by(monkeypatch, sort_by, expected):
      if parse_version(cleanlab.__version__) < parse_version("2.0"):
  
          def mock_get_noise_indices(*args, **kwargs):
              assert kwargs["sorted_index_method"] == expected[0]
              return []
  
          monkeypatch.setattr(
              "cleanlab.pruning.get_noise_indices",
              mock_get_noise_indices,
          )
      else:
  
          def mock_find_label_issues(*args, **kwargs):
              assert kwargs["return_indices_ranked_by"] == expected[1]
              return []
  
          monkeypatch.setattr(
              "cleanlab.filter.find_label_issues",
              mock_find_label_issues,
          )
  
      record = TextClassificationRecord(
          text="mock", prediction=[("mock", 0.1)], annotation="mock"
      )
      find_label_errors(records=[record], sort_by=sort_by)
  
imports: import sys
  import cleanlab
  import pytest
  from argilla import User
  from argilla.client.api import delete, load, log
  from argilla.client.models import TextClassificationRecord
  from argilla.client.singleton import init
  from argilla.labeling.text_classification import find_label_errors
  from argilla.labeling.text_classification.label_errors import MissingPredictionError, NoRecordsError, SortBy, _construct_s_and_psx
  from pkg_resources import parse_version
label_desc: Use image node_id 6 for calling a global function with example usage: test_sort_by(monkeypatch, sort_by, expected) and returns: list, list