code: def _save_AnchorImage(
      explainer: "AnchorImage", path: Union[str, os.PathLike]
  ) -> None:
      # save the segmentation function separately (could be user-supplied or built-in), must be picklable
      segmentation_fn = explainer.segmentation_fn
      explainer.segmentation_fn = None
      with open(Path(path, "segmentation_fn.dill"), "wb") as f:
          dill.dump(segmentation_fn, f, recurse=True)
  
      predictor = explainer.predictor
      explainer.predictor = None  # type: ignore[assignment]
      with open(Path(path, "explainer.dill"), "wb") as f:
          dill.dump(explainer, f, recurse=True)
      explainer.segmentation_fn = segmentation_fn
      explainer.predictor = predictor
  
imports: import copy
  import json
  import numbers
  import os
  from pathlib import Path
  import sys
  from typing import Callable, TYPE_CHECKING, Union
  import warnings
  import dill
  import numpy
  from alibi.version import __version__
label_desc: Use image node_id 8 for calling a global function with example usage: _save_AnchorImage(explainer, path) without return types