code: def test_calibrate_threshold_invalid_parameters_right_error(
      invalid_args, expected_msg
  ):
      # test that the right error message is returned if invalid arguments are
      # given to calibrate_threshold
      rng = np.random.RandomState(42)
      pairs, y = rng.randn(20, 2, 5), rng.choice([-1, 1], size=20)
      pairs_learner = IdentityPairsClassifier()
      pairs_learner.fit(pairs, y)
      with pytest.raises(ValueError) as raised_error:
          pairs_learner.calibrate_threshold(pairs, y, **invalid_args)
      assert str(raised_error.value) == expected_msg
  
imports: from functools import partial
  import pytest
  from numpy.testing import assert_array_equal
  from scipy.spatial.distance import euclidean
  from metric_learn.base_metric import _PairsClassifierMixin, MahalanobisMixin
  from sklearn.exceptions import NotFittedError
  from sklearn.metrics import f1_score, accuracy_score, fbeta_score, precision_score
  from sklearn.model_selection import train_test_split
  from test.test_utils import pairs_learners, ids_pairs_learners
  from metric_learn.sklearn_shims import set_random_state
  from sklearn import clone
  import numpy
  from itertools import product
label_desc: Use image node_id 15 for calling a global function with example usage: test_calibrate_threshold_invalid_parameters_right_error(invalid_args, expected_msg) without return types