docs: def _to_json_default(obj):
      """Helper to convert non default objects to json.
  
      Usage:
          simplejson.dumps(data, default=_to_json_default)
      """
      # Datetime
      if isinstance(obj, datetime.datetime):
          return obj.isoformat()
  
      # UUID
      if isinstance(obj, uuid.UUID):
          return str(obj)
  
      # numpy
      if hasattr(obj, 'item'):
          return obj.item()
  
      # # Enum
      # if hasattr(obj, 'value'):
      #     return obj.value
  
      try:
          return obj.id
      except Exception:
          raise TypeError('{obj} is not JSON serializable'.format(obj=repr(obj)))