code: def num_pos_neg(y_true, y_pred=None, pos_label=1, sample_weight=None):
      """Compute the number of positive and negative samples.
  
      Args:
          y_true (array-like): Ground truth (correct) target values. If y_pred is
              provided, this is ignored.
          y_pred (array-like): Estimated targets as returned by a classifier.
          pos_label (scalar, optional): The label of the positive class.
          sample_weight (array-like, optional): Sample weights.
  
      Returns:
          tuple:
              Number of positives and negatives.
  
              * **n_positive** (`float`) -- (Weighted) number of positive samples.
              * **n_negative** (`float`) -- (Weighted) number of negative samples.
      """
      y = y_true if y_pred is None else y_pred
      sample_weight = check_inputs(
          y_true, y, sample_weight, ensure_2d=False
      )[2]
      pos = (y == pos_label).tolist()
      neg = (y != pos_label).tolist()
      return sum(sample_weight[pos]), sum(sample_weight[neg])
  
imports: from itertools import permutations
  from typing import Union
  import warnings
  import numpy
  import pandas
  from scipy.special import rel_entr
  from sklearn.metrics import make_scorer, recall_score, precision_score
  from sklearn.metrics import multilabel_confusion_matrix
  from sklearn.metrics._classification import _prf_divide, _check_zero_division
  from sklearn.neighbors import NearestNeighbors
  from sklearn.utils import check_X_y
  from aif360.metrics import ot_metric
  from aif360.sklearn.utils import check_inputs, check_groups
  from aif360.detectors.mdss.ScoringFunctions import BerkJones, Bernoulli
  from aif360.detectors.mdss.MDSS import MDSS
label_desc: Use image node_id 7 for calling a global function with example usage: num_pos_neg(y_true, y_pred, pos_label, sample_weight) and returns: sum,  sum