code: def test_confident_learning_filter_multilabel(
      return_indices_of_off_diagonals,
  ):
      dataset = multilabel_data
  
      if return_indices_of_off_diagonals:
          cj, indices = count.compute_confident_joint(
              labels=dataset["labels"],
              pred_probs=dataset["pred_probs"],
              calibrate=False,
              return_indices_of_off_diagonals=True,
              multi_label=True,
          )
          # Check that the number of 'label issues' found in off diagonals
          # matches the off diagonals of the uncalibrated confident joint
  
          for c, ind in zip(cj, indices):
              assert len(ind) == (np.sum(c) - np.trace(c))
      else:
          cj = count.compute_confident_joint(
              labels=dataset["labels"],
              pred_probs=dataset["pred_probs"],
              calibrate=False,
              return_indices_of_off_diagonals=return_indices_of_off_diagonals,
              multi_label=True,
          )
          for c in cj:
              assert np.trace(c) > -1
  
imports: import cleanlab.multilabel_classification.dataset
  from cleanlab import count, filter
  from cleanlab.count import get_confident_thresholds, estimate_py_and_noise_matrices_from_probabilities
  from cleanlab.internal.latent_algebra import compute_inv_noise_matrix
  from cleanlab.benchmarking.noise_generation import generate_noise_matrix_from_trace
  from cleanlab.benchmarking.noise_generation import generate_noisy_labels
  from cleanlab.internal.util import value_counts
  from cleanlab.internal.multilabel_utils import int2onehot
  from cleanlab.experimental.label_issues_batched import find_label_issues_batched
  import numpy
  import scipy
  import pytest
  from sklearn.multioutput import MultiOutputClassifier
  from sklearn.linear_model import LogisticRegression
  from sklearn.model_selection import cross_val_predict
  from tempfile import mkdtemp
  import os.path
label_desc: Use image node_id 22 for calling a global function with example usage: test_confident_learning_filter_multilabel(return_indices_of_off_diagonals) without return types