code: def test_get_normalized_margin_for_each_label():
      scores = rank.get_normalized_margin_for_each_label(
          data["labels"], data["pred_probs"]
      )
      label_errors = np.arange(len(data["labels"]))[
          data["label_errors_mask"]
      ]
      least_confident_label = np.argmin(scores)
      most_confident_label = np.argmax(scores)
      assert least_confident_label in label_errors
      assert most_confident_label not in label_errors
  
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 2 for calling a global function with example usage: test_get_normalized_margin_for_each_label() without return types