code: def default(self, value):
      try:
          if type(value).__module__ == np.__name__ and isinstance(
              value, np.ndarray
          ):
              return value.tolist()
  
          if isinstance(value, np.bool_):
              return bool(value)
  
          if np.isnan(value):
              return self.nan_str
  
          if issubclass(type(value), numbers.Integral):
              return int(value)
          if issubclass(type(value), numbers.Number):
              return float(value)
  
          return super(SafeFallbackEncoder, self).default(value)
  
      except Exception:
          return str(value)
  
imports: import json
  import numbers
  import numpy
label_desc: Use image node_id 2 for calling the SafeFallbackEncoder obj's underlying member method code with example usage: obj.default(value) and returns: super, value, bool, self, int, float, str