class_docstr: Class for computing metrics based on a single
  :obj:`~aif360.datasets.BinaryLabelDataset`.
class_docstr_tok: ["Class","for","computing","metrics","based","on","a","single",":","obj",":","`","~aif360.datasets.BinaryLabelDataset","`","."]
docstr: Compute the number of positives,
  :math:`P = \sum_{i=1}^n \mathbb{1}[y_i = 1]`,
  optionally conditioned on protected attributes.
  
  Args:
      privileged (bool, optional): Boolean prescribing whether to
          condition this metric on the `privileged_groups`, if `True`, or
          the `unprivileged_groups`, if `False`. Defaults to `None`
          meaning this metric is computed over the entire dataset.
  
  Raises:
      AttributeError: `privileged_groups` or `unprivileged_groups` must be
          must be provided at initialization to condition on them.
docstr_tok: ["Compute","the","number","of","positives",",",":","math",":","`","P","=","\\sum_","{","i=1","}","^n","\\mathbb","{","1","}","[","y_i","=","1","]","`",",","optionally","conditioned","on","protected","attributes",".","Args",":","privileged","(","bool",",","optional",")",":","Boolean","prescribing","whether","to","condition","this","metric","on","the","`","privileged_groups","`",",","if","`","True","`",",","or","the","`","unprivileged_groups","`",",","if","`","False","`",".","Defaults","to","`","None","`","meaning","this","metric","is","computed","over","the","entire","dataset",".","Raises",":","AttributeError",":","`","privileged_groups","`","or","`","unprivileged_groups","`","must","be","must","be","provided","at","initialization","to","condition","on","them","."]
code: def num_positives(self, privileged=None):
      r"""Compute the number of positives,
      :math:`P = \sum_{i=1}^n \mathbb{1}[y_i = 1]`,
      optionally conditioned on protected attributes.
  
      Args:
          privileged (bool, optional): Boolean prescribing whether to
              condition this metric on the `privileged_groups`, if `True`, or
              the `unprivileged_groups`, if `False`. Defaults to `None`
              meaning this metric is computed over the entire dataset.
  
      Raises:
          AttributeError: `privileged_groups` or `unprivileged_groups` must be
              must be provided at initialization to condition on them.
      """
      condition = self._to_condition(privileged)
      return utils.compute_num_pos_neg(
          self.dataset.protected_attributes,
          self.dataset.labels,
          self.dataset.instance_weights,
          self.dataset.protected_attribute_names,
          self.dataset.favorable_label,
          condition=condition,
      )
  
imports: import numpy
  from sklearn.neighbors import NearestNeighbors
  from aif360.algorithms.inprocessing.gerryfair.auditor import Auditor
  from aif360.datasets import BinaryLabelDataset
  from aif360.datasets.multiclass_label_dataset import MulticlassLabelDataset
  from aif360.metrics import DatasetMetric, utils
  from aif360.algorithms.inprocessing.gerryfair.clean import *
label_desc: Use image node_id 2 for calling the BinaryLabelDatasetMetric obj's underlying member method code with example usage: obj.num_positives(privileged) and returns: utils