code: def _object_to_json(obj):
          
          if isinstance(obj, datetime.datetime):
              return obj.isoformat()
          return repr(obj)
docs: Convert objects that cannot be natively serialized into JSON
          into their string representation
  
          For datetime based objects convert them into their ISO formatted
          string as specified by :meth:`datetime.datetime.isoformat`.
  
          :param obj: object to convert into a JSON via getting its string
              representation.
          :type obj: object
  
          :return: String value representing the given object ready to be
              encoded into a JSON.
          :rtype: str