code: def _json_safe(cls, value):
          
          # Date
          if type(value) == date:
              return str(value)
  
          # Datetime
          elif type(value) == datetime:
              return value.strftime('%Y-%m-%d %H:%M:%S')
  
          # Object Id
          elif isinstance(value, ObjectId):
              return str(value)
  
          # Frame
          elif isinstance(value, _BaseFrame):
              return value.to_json_type()
  
          # Lists
          elif isinstance(value, (list, tuple)):
              return [cls._json_safe(v) for v in value]
  
          # Dictionaries
          elif isinstance(value, dict):
              return {k:cls._json_safe(v) for k, v in value.items()}
  
          return value
docs: Return a JSON safe value