code: def test_order_label_issues_using_scoring_func_ranking(
      scoring_method_func, adjust_pred_probs
  ):
      # test all scoring methods with the scoring function
  
      method, scoring_func = scoring_method_func
  
      # check if method supports adjust_pred_probs
      # do not run the test below if the method does not support adjust_pred_probs
      # confidence_weighted_entropy scoring method does not support adjust_pred_probs
      if not (
          adjust_pred_probs == True
          and method == "confidence_weighted_entropy"
      ):
          indices = np.arange(len(data["label_errors_mask"]))[
              data["label_errors_mask"]
          ]  # indices of label issues
  
          label_issues_indices = rank.order_label_issues(
              label_issues_mask=data["label_errors_mask"],
              labels=data["labels"],
              pred_probs=data["pred_probs"],
              rank_by=method,
              rank_by_kwargs={"adjust_pred_probs": adjust_pred_probs},
          )
  
          # test scoring function with scoring method passed as arg
          scores = rank.get_label_quality_scores(
              data["labels"],
              data["pred_probs"],
              method=method,
              adjust_pred_probs=adjust_pred_probs,
          )
          scores = scores[data["label_errors_mask"]]
          score_idx = sorted(
              list(zip(scores, indices)), key=lambda y: y[0]
          )  # sort indices by score
          label_issues_indices2 = [z[1] for z in score_idx]
          assert all(
              label_issues_indices == label_issues_indices2
          ), f"Test failed with scoring method: {method}"
  
          # test individual scoring function
          # only test if adjust_pred_probs=False because the individual scoring functions do not adjust pred_probs
          if not adjust_pred_probs:
              scores = scoring_func(data["labels"], data["pred_probs"])
              scores = scores[data["label_errors_mask"]]
              score_idx = sorted(
                  list(zip(scores, indices)), key=lambda y: y[0]
              )  # sort indices by score
              label_issues_indices3 = [z[1] for z in score_idx]
              assert all(
                  label_issues_indices == label_issues_indices3
              ), f"Test failed with scoring method: {method}"
  
imports: import numpy
  import pytest
  from cleanlab import rank
  from cleanlab.internal.label_quality_utils import _subtract_confident_thresholds
  from cleanlab.benchmarking.noise_generation import generate_noise_matrix_from_trace
  from cleanlab.benchmarking.noise_generation import generate_noisy_labels
  from cleanlab import count
  from cleanlab import outlier
  from sklearn.neighbors import NearestNeighbors
label_desc: Use image node_id 5 for calling a global function with example usage: test_order_label_issues_using_scoring_func_ranking(scoring_method_func, adjust_pred_probs) without return types