class_docstr: Metric Parser for clarify bias
class_docstr_tok: ["Metric","Parser","for","clarify","bias"]
docstr: Implement ParserBase._parse.
  
  Args:
      json_data (dict): Raw metric data.
docstr_tok: ["Implement","ParserBase._parse",".","Args",":","json_data","(","dict",")",":","Raw","metric","data","."]
code: def _parse(self, json_data: dict):
      """Implement ParserBase._parse.
  
      Args:
          json_data (dict): Raw metric data.
      """
      result = {"metric_groups": []}
      for metric_grp, facets in json_data.items():
          if isinstance(facets, dict):
              for facet_name, facet in facets["facets"].items():
                  group_data = defaultdict(list)
                  for item in facet:
                      grp_name = (
                          f"{metric_grp} - label {facets['label']} = "
                          f"{facets['label_value_or_threshold']} and "
                          f"facet {facet_name}={item['value_or_threshold']}"
                      )
                      group_data[grp_name].extend(
                          [
                              {
                                  "name": i["name"],
                                  "value": i["value"],
                                  "type": "number",
                              }
                              for i in item["metrics"]
                              if i["value"] is not None
                          ]
                      )
                  for group_name, metric_data in group_data.items():
                      result["metric_groups"].append(
                          {
                              "name": group_name,
                              "metric_data": metric_data,
                          }
                      )
  
      return result
  
imports: from __future__ import absolute_import
  from abc import ABC, abstractmethod
  from enum import Enum
  from collections import defaultdict
  from typing import Union, List
  from sagemaker.model_card.schema_constraints import PYTHON_TYPE_TO_METRIC_VALUE_TYPE, METRIC_VALUE_TYPE_MAP, MetricTypeEnum
label_desc: Use image node_id 2 for calling the ClarifyBiasParser obj's underlying member method code with example usage: obj._parse(json_data) and returns: result