code: def make_perturb_func(
      perturb_func: PerturbFunc,
      perturb_func_kwargs: Mapping[str, ...] | None,
      **kwargs,
  ) -> PerturbFunc | functools.partial:
      """A utility function to save few lines of code during perturbation metric initialization."""
      if perturb_func_kwargs is not None:
          func_kwargs = kwargs.copy()
          func_kwargs.update(perturb_func_kwargs)
      else:
          func_kwargs = kwargs
  
      return functools.partial(perturb_func, **func_kwargs)
  
file_path: Quantus/quantus/helpers/perturbation_utils.py
imports: from __future__ import annotations
  import sys
  from typing import List, TYPE_CHECKING, Callable, Mapping
  import numpy
  import functools
label_desc: Use image node_id 1 for calling a global function with example usage: make_perturb_func(perturb_func, perturb_func_kwargs) and returns: functools