code: def Serializable(o):
      
      if isinstance(o, (str, dict, int)):
          return o
      else:
          try:
              json.dumps(o)
              return o
          except Exception:
              LOG.debug("Got a non-serilizeable object: %s" % o)
              return o.__repr__()
docs: Make sure an object is JSON-serializable
      Use this to return errors and other info that does not need to be
      deserialized or does not contain important app data. Best for returning
      error info and such