code: def render_fairness_indicator(
      eval_result: Optional[view_types.EvalResult] = None,
      multi_eval_results: Optional[
          Dict[str, view_types.EvalResult]
      ] = None,
      slicing_column: Optional[str] = None,
      slicing_spec: Optional[slicer.SingleSliceSpec] = None,
      output_name: str = "",
      multi_class_key: str = "",
      event_handlers: Optional[Dict[str, Callable[..., Any]]] = None,
  ) -> Optional[Any]:
      """Renders the Fairness Indicator view.
  
      Args:
        eval_result: An tfma.EvalResult.
        multi_eval_results: A map {string: tfma.EvalResult} of length 2, mapping an
          eval or model name to an EvalResult. This can be used for model
          comparison.
        slicing_column: The slicing column to to filter results. If both
          slicing_column and slicing_spec are None, show all eval results. This is
          ignored for cross slice comparison based results.
        slicing_spec: The slicing spec to filter results. If both slicing_column and
          slicing_spec are None, show all eval results. This is ignored for cross
          slice comparison based results.
        output_name: The output name associated with metric (for multi-output
          models).
        multi_class_key: The multi-class key associated with metric (for multi-class
          models).
        event_handlers: The event handler callback.
  
      Returns:
        A FairnessIndicatorViewer object if in Jupyter notebook; None if in Colab.
      """
      if (eval_result and multi_eval_results) or (
          not eval_result and not multi_eval_results
      ):
          raise ValueError(
              'Exactly one of the "eval_result" and "multi_eval_results" '
              "parameters must be set."
          )
  
      if multi_eval_results and len(multi_eval_results) != 2:
          raise ValueError(
              '"multi_eval_results" parameter only accepts 2 eval results.'
          )
  
      data = None
      multi_data = None
      if eval_result:
          data = convert_slicing_metrics_to_ui_input(
              eval_result.slicing_metrics,
              slicing_column,
              slicing_spec,
              output_name,
              multi_class_key,
          )
      else:
          multi_data = {}
          for eval_name in multi_eval_results:
              multi_data[
                  eval_name
              ] = convert_slicing_metrics_to_ui_input(
                  multi_eval_results[eval_name].slicing_metrics,
                  slicing_column,
                  slicing_spec,
                  output_name,
                  multi_class_key,
              )
      return visualization.render_fairness_indicator(
          data, multi_data, event_handlers
      )
  
file_path: model-analysis/tensorflow_model_analysis/addons/fairness/view/widget_view.py
imports: from typing import Optional, Dict, Callable, Any, List, Tuple
  import tensorflow
  from tensorflow_model_analysis.addons.fairness.notebook import visualization
  from tensorflow_model_analysis.slicer import slicer_lib
  from tensorflow_model_analysis.view import view_types
label_desc: Use image node_id 4 for calling a global function with example usage: render_fairness_indicator(eval_result, multi_eval_results, slicing_column, slicing_spec, output_name, multi_class_key, event_handlers) and returns: visualization