code: def test_metric_initialization_invalid_direction(direction):
      with pytest.raises(
          ValueError,
          match="`direction` must be 'infer', 'max', or 'min', not .*",
      ):
          Metric("some_metric", roc_auc_score, direction)
  
imports: from hyperparameter_hunter.metrics import ScoringMixIn, Metric, format_metrics, wrap_xgboost_metric
  from hyperparameter_hunter.metrics import get_formatted_target_metric, get_clean_prediction
  from collections import OrderedDict
  import numpy
  import pandas
  import pytest
  import sys
  from sklearn.metrics import roc_auc_score, hamming_loss, r2_score, f1_score
label_desc: Use image node_id 8 for calling a global function with example usage: test_metric_initialization_invalid_direction(direction) without return types