code: def test_calibrate_decision_threshold_select_closer_to_0_5():
      """Test that calibration will choose the threshold closer to 0.5 in the case of a tie"""
      y, y_pred_proba = _get_sample_data()
      decision_threshold = calibrate_decision_threshold(
          y=y,
          y_pred_proba=y_pred_proba,
          metric=balanced_accuracy,
          decision_thresholds=[0.5, 0.244, 0.247],
      )
      assert decision_threshold == 0.247
  
      decision_threshold = calibrate_decision_threshold(
          y=y,
          y_pred_proba=y_pred_proba,
          metric=balanced_accuracy,
          decision_thresholds=[0.5, 0.247, 0.244],
      )
      assert decision_threshold == 0.247
  
file_path: autogluon/core/tests/unittests/calibrate/test_decision_threshold.py
imports: import numpy
  import pytest
  from autogluon.core.calibrate import calibrate_decision_threshold
  from autogluon.core.metrics import balanced_accuracy, f1, roc_auc
label_desc: Use image node_id 3 for calling a global function with example usage: test_calibrate_decision_threshold_select_closer_to_0_5() without return types