code: def default(self, obj):
      if isinstance(obj, np.ndarray):
          return obj.tolist()
      elif isinstance(obj, np.integer):
          return int(obj)
      elif isinstance(obj, np.floating):
          return float(obj)
      elif is_dataclass(obj):
          return obj.__dict__
      return JSONEncoder.default(self, obj)
  
file_path: DeepPavlov/deeppavlov/core/trainers/utils.py
imports: from collections import OrderedDict, namedtuple
  from dataclasses import is_dataclass
  from functools import partial
  from json import JSONEncoder
  from typing import List, Tuple, Union, Iterable
  import numpy
  from deeppavlov.core.common.metrics_registry import get_metric_by_name
label_desc: Use image node_id 1 for calling the NumpyArrayEncoder obj's underlying member method code with example usage: obj.default(obj) and returns: JSONEncoder, obj, int, float, obj