code: def test_pixel_flipping(
      model,
      data: np.ndarray,
      params: dict,
      expected: Union[float, dict, bool],
  ):
      x_batch, y_batch = (
          data["x_batch"],
          data["y_batch"],
      )
  
      init_params = params.get("init", {})
      call_params = params.get("call", {})
  
      if params.get("a_batch_generate", True):
          explain = call_params["explain_func"]
          explain_func_kwargs = call_params.get(
              "explain_func_kwargs", {}
          )
          a_batch = explain(
              model=model,
              inputs=x_batch,
              targets=y_batch,
              **explain_func_kwargs,
          )
      elif "a_batch" in data:
          a_batch = data["a_batch"]
      else:
          a_batch = None
  
      metric = PixelFlipping(**init_params)
  
      scores = metric(
          model=model,
          x_batch=x_batch,
          y_batch=y_batch,
          a_batch=a_batch,
          **call_params,
      )
  
      assert all(
          [
              (s >= expected["min"] and s <= expected["max"])
              for s_list in scores
              for s in s_list
          ]
      ), "Test failed."
  
imports: from typing import Union
  import pytest
  from pytest_lazyfixture import lazy_fixture
  import numpy
  from quantus.functions.explanation_func import explain
  from quantus.functions.perturb_func import baseline_replacement_by_indices, noisy_linear_imputation
  from quantus.functions.similarity_func import correlation_spearman, correlation_kendall_tau
  from quantus.helpers.model.model_interface import ModelInterface
  from quantus.metrics.faithfulness import FaithfulnessCorrelation, FaithfulnessEstimate, Infidelity, IROF, Monotonicity, MonotonicityCorrelation, PixelFlipping, RegionPerturbation, ROAD, Selectivity, SensitivityN, Sufficiency
label_desc: Use image node_id 6 for calling a global function with example usage: test_pixel_flipping(model, data, params, expected) without return types