code: def default(self, obj):
      if isinstance(
          obj,
          (
              np.int_,
              np.intc,
              np.intp,
              np.int8,
              np.int16,
              np.int32,
              np.int64,
              np.uint8,
              np.uint16,
              np.uint32,
              np.uint64,
          ),
      ):
          return int(obj)
      elif isinstance(
          obj, (np.float_, np.float16, np.float32, np.float64)
      ):
          return float(obj)
      elif isinstance(obj, (np.ndarray,)):
          return obj.tolist()
      return json.JSONEncoder.default(self, obj)
  
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 1 for calling the NumpyEncoder obj's underlying member method code with example usage: obj.default(obj) and returns: json, int, float, obj