code: def test_raise_not_fitted_error_if_not_fitted(
      estimator, build_dataset, with_preprocessor
  ):
      """Test that a NotFittedError is raised if someone tries to predict and
      the metric learner has not been fitted."""
      input_data, _, preprocessor, _ = build_dataset(with_preprocessor)
      estimator = clone(estimator)
      estimator.set_params(preprocessor=preprocessor)
      set_random_state(estimator)
      with pytest.raises(NotFittedError):
          estimator.predict(input_data)
  
file_path: metric-learn/test/test_triplets_classifiers.py
imports: import pytest
  from sklearn.exceptions import NotFittedError
  from sklearn.model_selection import train_test_split
  from metric_learn import SCML
  from test.test_utils import triplets_learners, ids_triplets_learners, build_triplets
  from metric_learn.sklearn_shims import set_random_state
  from sklearn import clone
  import numpy
  from numpy.testing import assert_array_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_raise_not_fitted_error_if_not_fitted(estimator, build_dataset, with_preprocessor) without return types