code: def _patch_metric_names(metric_dict):
      # XGBoost provides some metrics with "@", e.g. "ndcg@3" that are not valid MLflow metric names
      patched_metrics = {
          metric_name.replace("@", "_at_"): value
          for metric_name, value in metric_dict.items()
      }
      changed_keys = set(patched_metrics.keys()) - set(
          metric_dict.keys()
      )
      if changed_keys:
          _logger.info(
              "Identified one or more metrics with names containing the invalid character `@`."
              " These metric names have been sanitized by replacing `@` with `_at_`, as follows: %s",
              ", ".join(changed_keys),
          )
  
      return patched_metrics
  
imports: import logging
  import xgboost
  from packaging.version import Version
  from mlflow.utils.autologging_utils import ExceptionSafeAbstractClass
label_desc: Use image node_id 1 for calling a global function with example usage: _patch_metric_names(metric_dict) and returns: patched_metrics