code: def test_find_issues_using_pred_probs(
      self, issue_manager, pred_probs
  ):
      np.random.seed(SEED)
      issue_manager.find_issues(pred_probs=pred_probs)
      issues_sort, summary_sort, info_sort = (
          issue_manager.issues,
          issue_manager.summary,
          issue_manager.info,
      )
      expected_sorted_issue_mask = np.array(
          [False] * 46 + [True] + [False] * 3
      )
      assert np.all(
          issues_sort["is_non_iid_issue"] == expected_sorted_issue_mask
      ), "Issue mask should be correct"
      assert summary_sort["issue_type"][0] == "non_iid"
      assert summary_sort["score"][0] == pytest.approx(
          expected=0.0, abs=1e-7
      )
      assert (
          info_sort.get("p-value", None) is not None
      ), "Should have p-value"
      assert summary_sort["score"][0] == pytest.approx(
          expected=info_sort["p-value"], abs=1e-7
      )
  
      permutation = np.random.permutation(len(pred_probs))
      new_issue_manager = NonIIDIssueManager(
          datalab=issue_manager.datalab,
          metric="euclidean",
          k=10,
      )
  
      new_issue_manager.find_issues(pred_probs=pred_probs[permutation])
      issues_perm, summary_perm, info_perm = (
          new_issue_manager.issues,
          new_issue_manager.summary,
          new_issue_manager.info,
      )
      expected_permuted_issue_mask = np.array([False] * len(pred_probs))
      assert np.all(
          issues_perm["is_non_iid_issue"]
          == expected_permuted_issue_mask
      ), "Issue mask should be correct"
      assert summary_perm["issue_type"][0] == "non_iid"
      # ensure score is large, cannot easily ensure precise value because random seed has different effects on
      # different OS:
      assert summary_perm["score"][0] > 0.05
      assert (
          info_perm.get("p-value", None) is not None
      ), "Should have p-value"
      assert summary_perm["score"][0] == pytest.approx(
          expected=info_perm["p-value"], abs=1e-7
      )
  
file_path: cleanlab/tests/datalab/issue_manager/test_noniid.py
imports: import numpy
  import pytest
  from cleanlab.datalab.internal.issue_manager.noniid import NonIIDIssueManager, simplified_kolmogorov_smirnov_test
label_desc: Use image node_id 6 for calling the TestNonIIDIssueManager obj's underlying member method code with example usage: obj.test_find_issues_using_pred_probs(issue_manager, pred_probs) without return types