code: def _multi_label_confusion_matrix_plot(
      thresholds: Optional[List[float]] = None,
      num_thresholds: Optional[int] = None,
      name: str = MULTI_LABEL_CONFUSION_MATRIX_PLOT_NAME,
      eval_config: Optional[config_pb2.EvalConfig] = None,
      model_name: str = "",
      output_name: str = "",
      example_weighted: bool = False,
  ) -> metric_types.MetricComputations:
      """Returns computations for multi-label confusion matrix at thresholds."""
      if num_thresholds is not None and thresholds is not None:
          raise ValueError(
              "only one of thresholds or num_thresholds can be set at a time"
          )
      if num_thresholds is None and thresholds is None:
          thresholds = [0.5]
      if num_thresholds is not None:
          thresholds = [
              (i + 1) * 1.0 / (num_thresholds - 1)
              for i in range(num_thresholds - 2)
          ]
          thresholds = [-_EPSILON] + thresholds + [1.0 + _EPSILON]
  
      key = metric_types.PlotKey(
          name=name,
          model_name=model_name,
          output_name=output_name,
          example_weighted=example_weighted,
      )
      return [
          metric_types.MetricComputation(
              keys=[key],
              preprocessors=None,
              combiner=_MultiLabelConfusionMatrixPlotCombiner(
                  key=key,
                  eval_config=eval_config,
                  example_weighted=example_weighted,
                  thresholds=thresholds,
              ),
          )
      ]
  
file_path: model-analysis/tensorflow_model_analysis/metrics/multi_label_confusion_matrix_plot.py
imports: from typing import Dict, Iterable, List, Optional, NamedTuple
  import apache_beam
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.proto import metrics_for_slice_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: _multi_label_confusion_matrix_plot(thresholds, num_thresholds, name, eval_config, model_name, output_name, example_weighted) and returns: list