code: def generic_laplace(
      input,
      derivative2,
      output=None,
      mode="reflect",
      cval=0.0,
      extra_arguments=(),
      extra_keywords=None,
  ):
      """
      N-D Laplace filter using a provided second derivative function.
  
      Parameters
      ----------
      %(input)s
      derivative2 : callable
          Callable with the following signature::
  
              derivative2(input, axis, output, mode, cval,
                          *extra_arguments, **extra_keywords)
  
          See `extra_arguments`, `extra_keywords` below.
      %(output)s
      %(mode_multiple)s
      %(cval)s
      %(extra_keywords)s
      %(extra_arguments)s
      """
      if extra_keywords is None:
          extra_keywords = {}
      input = numpy.asarray(input)
      output = _ni_support._get_output(output, input)
      axes = list(range(input.ndim))
      if len(axes) > 0:
          modes = _ni_support._normalize_sequence(mode, len(axes))
          derivative2(
              input,
              axes[0],
              output,
              modes[0],
              cval,
              *extra_arguments,
              **extra_keywords,
          )
          for ii in range(1, len(axes)):
              tmp = derivative2(
                  input,
                  axes[ii],
                  output.dtype,
                  modes[ii],
                  cval,
                  *extra_arguments,
                  **extra_keywords,
              )
              output += tmp
      else:
          output[...] = input[...]
      return output
  
imports: from collections.abc import Iterable
  import warnings
  import numpy
  import operator
  from numpy.core.multiarray import normalize_axis_index
  from .None import _ni_support
  from .None import _nd_image
  from .None import _ni_docstrings
label_desc: Use image node_id 10 for calling a global function with example usage: generic_laplace(input, derivative2, output, mode, cval, extra_arguments, extra_keywords) and returns: output