code: def PrettyPrinter(obj):
    
  
    if ndb and isinstance(obj, ndb.Model):
      return six.iteritems(obj.to_dict()), 'ndb.Model(%s)' % type(obj).__name__
  
    if messages and isinstance(obj, messages.Enum):
      return [('name', obj.name), ('number', obj.number)], type(obj).__name__
  
    return None
docs: Pretty printers for AppEngine objects.