code: def test_generate_tf_explanation(
      model: ModelInterface,
      data: np.ndarray,
      params: dict,
      expected: Union[float, dict, bool],
  ):
      x_batch, y_batch = (data["x_batch"], data["y_batch"])
  
      if "exception" in expected:
          with pytest.raises(expected["exception"]):
              a_batch = generate_tf_explanation(
                  model=model, inputs=x_batch, targets=y_batch, **params
              )
          return
  
      a_batch = generate_tf_explanation(
          model=model, inputs=x_batch, targets=y_batch, **params
      )
  
      if isinstance(expected, float):
          assert all(s == expected for s in a_batch), "Test failed."
      else:
          if "min" in expected and "max" in expected:
              assert (a_batch.min() >= expected["min"]) & (
                  a_batch.max() <= expected["max"]
              ), "Test failed."
          elif "min" in expected and "max" not in expected:
              assert a_batch.min() >= expected["min"], "Test failed."
          elif "shape" in expected:
              assert a_batch.shape == expected["shape"], "Test failed."
          elif "min" not in expected and "max" in expected:
              assert a_batch.max() <= expected["max"], "Test failed."
          elif "value" in expected:
              assert all(
                  s == expected["value"] for s in a_batch.flatten()
              ), "Test failed."
  
file_path: Quantus/tests/functions/test_explanation_func.py
imports: import pytest
  from pytest_lazyfixture import lazy_fixture
  from zennit import attribution
  from zennit import torchvision
  from quantus.functions.explanation_func import *
  from quantus.functions.normalise_func import normalise_by_max
label_desc: Use image node_id 3 for calling a global function with example usage: test_generate_tf_explanation(model, data, params, expected) without return types