class_docstr: Custom JSON encoder which is NumPy-compatible.
class_docstr_tok: ["Custom","JSON","encoder","which","is","NumPy-compatible","."]
code: def default(self, obj):
      if isinstance(obj, np.integer):
          return int(obj)
      elif isinstance(obj, np.floating):
          return float(obj)
      elif isinstance(obj, np.ndarray):
          return obj.tolist()
      elif isinstance(obj, TensorSpec):
          return obj.json()
      else:
          return super().default(obj)
  
imports: from collections import OrderedDict
  import json
  import logging
  import os
  import random
  import numpy
  import tensorflow
  from tensorforce import util, TensorforceError
  from tensorforce.agents import Recorder
  import tensorforce.agents
  from tensorforce.core import ArrayDict, TensorSpec, TensorforceConfig
label_desc: Use image node_id 1 for calling the TensorforceJSONEncoder obj's underlying member method code with example usage: obj.default(obj) and returns: int, float, obj, obj, super