code: def _prune_by_class(args: list) -> np.ndarray:
      """multiprocessing Helper function for find_label_issues()
      that assumes globals and produces a mask for class k for each example by
      removing the examples with *smallest probability* of
      belonging to their given class label.
  
      Parameters
      ----------
      k : int (between 0 and num classes - 1)
        The class of interest."""
  
      k, min_examples_per_class, arrays = args
      if arrays is None:
          pred_probs = pred_probs_by_class[k]
          prune_count_matrix = prune_count_matrix_cols[k]
      else:
          pred_probs = arrays[0]
          prune_count_matrix = arrays[1]
  
      label_counts = pred_probs.shape[0]
      label_issues = np.zeros(label_counts, dtype=bool)
      if (
          label_counts > min_examples_per_class
      ):  # No prune if not at least min_examples_per_class
          num_issues = label_counts - prune_count_matrix[k]
          # Get return_indices_ranked_by of the smallest prob of class k for examples with noisy label k
          # rank = np.partition(class_probs, num_issues)[num_issues]
          if num_issues >= 1:
              class_probs = pred_probs[:, k]
              order = np.argsort(class_probs)
              label_issues[order[:num_issues]] = True
          return label_issues
  
      warnings.warn(
          f"May not flag all label issues in class: {k}, it has too few examples (see argument: `min_examples_per_class`)"
      )
      return label_issues
  
imports: import numpy
  from sklearn.metrics import confusion_matrix
  import multiprocessing
  import sys
  import warnings
  from typing import Any, Dict, Optional, Tuple, List
  from functools import reduce
  import platform
  from cleanlab.count import calibrate_confident_joint, num_label_issues, _reduce_issues
  from cleanlab.rank import order_label_issues, get_label_quality_scores
  import cleanlab.internal.multilabel_scorer
  from cleanlab.internal.validation import assert_valid_inputs
  from cleanlab.internal.util import value_counts_fill_missing_classes, round_preserving_row_totals, get_num_classes
  from cleanlab.internal.multilabel_utils import stack_complement, get_onehot_num_classes, int2onehot
  from cleanlab.typing import LabelLike
  from cleanlab.multilabel_classification.filter import find_multilabel_issues_per_class
label_desc: Use image node_id 11 for calling a global function with example usage: _prune_by_class(args) and returns: label_issues, label_issues