code: def get_minmax_mode(
      metric_name: Union[str, Scorer],
  ):
      """
      Get minmax mode based on metric name
  
      Parameters
      ----------
      metric_name
          A string representing metric
  
      Returns
      -------
      mode
          The min/max mode used in selecting model checkpoints.
          - min
               Its means that smaller metric is better.
          - max
              It means that larger metric is better.
      """
      if isinstance(metric_name, str):
          assert (
              metric_name in METRIC_MODE_MAP
          ), f"{metric_name} is not a supported metric. Options are: {METRIC_MODE_MAP.keys()}"
          return METRIC_MODE_MAP.get(metric_name)
      else:
          return MAX if metric_name.greater_is_better else MIN
  
imports: import logging
  import math
  import operator
  import warnings
  from typing import Dict, List, Optional, Tuple, Union
  import evaluate
  import numpy
  from sklearn.metrics import f1_score
  from autogluon.core.metrics import Scorer, get_metric
  from ..constants import ACCURACY, AVERAGE_PRECISION, BINARY, DIRECT_LOSS, F1, FEW_SHOT_CLASSIFICATION, IOU, MAP, MATCHING_METRICS, MATCHING_METRICS_WITHOUT_PROBLEM_TYPE, MAX, METRIC_MODE_MAP, MIN, MULTICLASS, NDCG, NER, NER_TOKEN_F1, NUMERICAL, OBJECT_DETECTION, OPEN_VOCABULARY_OBJECT_DETECTION, OVERALL_ACCURACY, OVERALL_F1, PRECISION, RECALL, REGRESSION, RETRIEVAL_METRICS, RMSE, ROC_AUC, SEMANTIC_SEGMENTATION, SPEARMANR, Y_PRED, Y_PRED_PROB, Y_TRUE
  from ..problem_types import PROBLEM_TYPES_REG
label_desc: Use image node_id 2 for calling a global function with example usage: get_minmax_mode(metric_name) and returns: METRIC_MODE_MAP, unknown