code: def test_return_nan_when_prediction_changes(
      metric, model, data, params, mock_prediction_changed
  ):
      # This test case requires different set-up and assertions, so we have it in separate function.
      metric_instance = metric(
          **params,
          disable_warnings=True,
          nr_samples=10,
          return_nan_when_prediction_changes=True,
      )
      result = metric_instance(
          model,
          data["x_batch"],
          data["y_batch"],
          explain_func=explain,
          explain_func_kwargs={
              "method": "Saliency",
          },
      )
      assert np.isnan(result).all()
  
file_path: Quantus/tests/metrics/test_robustness_metrics.py
imports: from typing import Union, Dict
  from pytest_lazyfixture import lazy_fixture
  import pytest
  import numpy
  from quantus.functions.explanation_func import explain
  from quantus.functions.discretise_func import floating_points, rank, sign, top_n_sign
  from quantus.helpers.model.model_interface import ModelInterface
  from quantus.metrics.robustness import AvgSensitivity, Consistency, Continuity, LocalLipschitzEstimate, MaxSensitivity
label_desc: Use image node_id 6 for calling a global function with example usage: test_return_nan_when_prediction_changes(metric, model, data, params, mock_prediction_changed) without return types