code: def lipschitz_constant(
      a: np.array,
      b: np.array,
      c: Union[np.array, None],
      d: Union[np.array, None],
      **kwargs,
  ) -> float:
      """
      Calculate non-negative local Lipschitz abs(||a-b||/||c-d||), where a,b can be f(x) or a(x) and c,d is x.
  
      For numerical stability, a small value is added to division.
  
      Parameters
      ----------
      a: np.ndarray
           The first array to use for similarity scoring.
      b: np.ndarray
           The second array to use for similarity scoring.
      c: np.ndarray
           The third array to use for similarity scoring.
      d: np.ndarray
           The fourth array to use for similarity scoring.
      kwargs: optional
          Keyword arguments.
  
      Returns
      -------
      float
          The similarity score.
      """
      eps = 1e-10
  
      d1 = kwargs.get("norm_numerator", distance_manhattan)
      d2 = kwargs.get("norm_denominator", distance_euclidean)
  
      if np.shape(a) == ():
          return float(abs(a - b) / (d2(c, d) + eps))
      else:
          return float(d1(a, b) / (d2(a=c, b=d) + eps))
  
file_path: Quantus/quantus/functions/similarity_func.py
imports: from typing import Union
  import numpy
  import scipy
  import skimage
label_desc: Use image node_id 7 for calling a global function with example usage: lipschitz_constant(a, b, c, d) and returns: float, float