class_docstr: Class for computing metrics based on one StructuredDataset.
docstr: Converts a boolean condition to a group-specifying format that can be
  used to create a conditioning vector.
code: def _to_condition(self, privileged):
      """Converts a boolean condition to a group-specifying format that can be
      used to create a conditioning vector.
      """
      if privileged is True and self.privileged_groups is None:
          raise AttributeError(
              "'privileged_groups' was not provided when "
              "this object was initialized."
          )
      if privileged is False and self.unprivileged_groups is None:
          raise AttributeError(
              "'unprivileged_groups' was not provided when "
              "this object was initialized."
          )
  
      if privileged is None:
          return None
      return (
          self.privileged_groups
          if privileged
          else self.unprivileged_groups
      )
  
file_path: AIF360/aif360/metrics/dataset_metric.py
imports: import numpy
  from aif360.datasets import StructuredDataset
  from aif360.metrics import Metric, utils
label_desc: Use image node_id 2 for calling the DatasetMetric obj's underlying member method code with example usage: obj._to_condition(privileged) and returns: unknown, None