code: def assess_model_fit(
      diagnostics: CVDiagnostics,
      significance_level: float = 0.1,
  ) -> AssessModelFitResult:
      """Assess model fit for given diagnostics results.
  
      It determines if a model fit is good or bad based on Fisher exact test p
  
      Args:
          diagnostics: Output of compute_diagnostics
  
      Returns:
          Two dictionaries, one for good metrics, one for bad metrics, each
          mapping metric name to p-value
      """
  
      good_fit_metrics_to_fisher_score: Dict[str, float] = {}
      bad_fit_metrics_to_fisher_score: Dict[str, float] = {}
  
      for metric, score in diagnostics[FISHER_EXACT_TEST_P].items():
          if score > significance_level:
              bad_fit_metrics_to_fisher_score[metric] = score
          else:
              good_fit_metrics_to_fisher_score[metric] = score
      if len(bad_fit_metrics_to_fisher_score) > 0:
          logger.warning(
              "{} {} {} unable to be reliably fit.".format(
                  (
                      "Metrics"
                      if len(bad_fit_metrics_to_fisher_score) > 1
                      else "Metric"
                  ),
                  (" , ".join(bad_fit_metrics_to_fisher_score.keys())),
                  (
                      "were"
                      if len(bad_fit_metrics_to_fisher_score) > 1
                      else "was"
                  ),
              )
          )
      return AssessModelFitResult(
          good_fit_metrics_to_fisher_score=good_fit_metrics_to_fisher_score,
          bad_fit_metrics_to_fisher_score=bad_fit_metrics_to_fisher_score,
      )
  
imports: from abc import ABC, abstractmethod
  from collections import defaultdict
  from enum import Enum
  from functools import partial
  from logging import Logger
  from numbers import Number
  from typing import Any, Callable, Dict, Iterable, List, NamedTuple, Optional, Set, Tuple
  import numpy
  from ax.core.observation import Observation, ObservationData
  from ax.core.optimization_config import OptimizationConfig
  from ax.modelbridge.base import ModelBridge
  from ax.utils.common.logger import get_logger
  from ax.utils.stats.model_fit_stats import _correlation_coefficient, _fisher_exact_test_p, _log_likelihood, _mape, _mean_prediction_ci, _rank_correlation, _total_raw_effect, _wmape, compute_model_fit_metrics
label_desc: Use image node_id 5 for calling a global function with example usage: assess_model_fit(diagnostics, significance_level) and returns: AssessModelFitResult