code: def get_model_select_metric(self, metrics):
      if (
          self.model_select_metric
          == ComparableClassificationMetric.ACCURACY
      ):
          metric = metrics.accuracy
      elif (
          self.model_select_metric
          == ComparableClassificationMetric.ROC_AUC
      ):
          metric = metrics.roc_auc
      elif (
          self.model_select_metric == ComparableClassificationMetric.MCC
      ):
          metric = metrics.mcc
      elif (
          self.model_select_metric
          == ComparableClassificationMetric.MACRO_F1
      ):
          metric = metrics.macro_prf1_metrics.macro_scores.f1
      elif (
          self.model_select_metric
          == ComparableClassificationMetric.LABEL_F1
      ):
          metric = metrics.macro_prf1_metrics.per_label_scores[
              self.target_label
          ].f1
      elif (
          self.model_select_metric
          == ComparableClassificationMetric.LABEL_AVG_PRECISION
      ):
          metric = metrics.per_label_soft_scores[
              self.target_label
          ].average_precision
      elif (
          self.model_select_metric
          == ComparableClassificationMetric.LABEL_ROC_AUC
      ):
          metric = metrics.per_label_soft_scores[
              self.target_label
          ].roc_auc
      elif (
          self.model_select_metric
          == ComparableClassificationMetric.NEGATIVE_LOSS
      ):
          metric = -metrics.loss
      else:
          raise ValueError(
              f"unknown metric: {self.model_select_metric}"
          )
  
      assert metric is not None
      return metric
  
imports: from enum import Enum
  from itertools import tee, zip_longest
  from typing import Generator, List, Optional, Sequence
  import torch
  from pytext.common.constants import Stage
  from pytext.data import CommonMetadata
  from pytext.metrics import ClassificationMetrics, compute_classification_metrics, compute_multi_label_classification_metrics, LabelListPrediction, LabelPrediction, LabelTopKPrediction, RECALL_AT_PRECISION_THRESHOLDS, safe_division
  from pytext.metrics.intent_slot_metrics import PerLabelConfusions
  from .channel import Channel, ConsoleChannel, FileChannel
  from .metric_reporter import MetricReporter
label_desc: Use image node_id 11 for calling the ClassificationMetricReporter obj's underlying member method code with example usage: obj.get_model_select_metric(metrics) and returns: metric