code: def compute_num_pos_neg(
      X, y, w, feature_names, label, condition=None
  ):
      """Compute the number of positives, :math:`P`, or negatives, :math:`N`,
      optionally conditioned on protected attributes.
  
      Args:
          X (numpy.ndarray): Dataset features.
          y (numpy.ndarray): Label vector.
          w (numpy.ndarray): Instance weight vector.
          feature_names (list): Names of the features.
          label (float): Value of label (unfavorable/positive or
              unfavorable/negative).
          condition (list(dict)): Same format as
              :func:`compute_boolean_conditioning_vector`.
  
      Returns:
          int: Number of positives/negatives (optionally conditioned)
      """
      y = y.ravel()
      cond_vec = compute_boolean_conditioning_vector(
          X, feature_names, condition=condition
      )
      return np.sum(
          w[np.logical_and(y == label, cond_vec)], dtype=np.float64
      )
  
imports: import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: compute_num_pos_neg(X, y, w, feature_names, label, condition) and returns: np