code: def assert_metric_and_label_details(cls, config, label_names):
      if config.model_select_metric in (
          ComparableClassificationMetric.LABEL_F1,
          ComparableClassificationMetric.LABEL_AVG_PRECISION,
          ComparableClassificationMetric.LABEL_ROC_AUC,
      ):
          assert (
              config.target_label is not None
          ), "target_label must be set for selected metric"
          assert config.target_label in label_names
      if config.model_select_metric in (
          ComparableClassificationMetric.ROC_AUC,
          ComparableClassificationMetric.MCC,
      ):
          assert (
              len(label_names) == 2
          ), "selected metric is valid for binary labels only"
  
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 4 for calling the ClassificationMetricReporter obj's underlying member method code with example usage: obj.assert_metric_and_label_details(cls, config, label_names) without return types