code: def test_relative_input_stability(
      model: tf.keras.Model,
      data: Dict[str, np.ndarray],
      init_kwargs,
      call_kwargs,
  ):
      ris = RIS_CONSTRUCTOR(**init_kwargs)
      x_batch = data["x_batch"]
      y_batch = predict(model, x_batch)
  
      result = ris(
          model=model,
          x_batch=x_batch,
          y_batch=y_batch,
          explain_func=explain,
          **call_kwargs,
      )
      result = np.asarray(result)
      assert (result != np.nan).all()
      if init_kwargs.get("return_aggregate", False):
          assert result.shape == (1,)
      else:
          assert result.shape[0] == x_batch.shape[0]
  
file_path: Quantus/tests/metrics/test_relative_stability.py
imports: from __future__ import annotations
  import pytest
  import torch
  from pytest_lazyfixture import lazy_fixture
  from typing import Dict, TYPE_CHECKING
  import functools
  from quantus.functions.perturb_func import *
  from quantus.functions.explanation_func import explain
  from quantus.metrics.robustness import RelativeInputStability, RelativeOutputStability, RelativeRepresentationStability
label_desc: Use image node_id 2 for calling a global function with example usage: test_relative_input_stability(model, data, init_kwargs, call_kwargs) without return types