def ProjectEntity(entity, fields):  # pragma: no cover.
  """Projects fields from entity. Returns dict."""
  entity_info = {}
  for field in fields:
    if hasattr(entity, field):
      entity_info[field] = getattr(entity, field)
    else:
      entity_info[field] = None
  entity_info['id'] = entity.key.urlsafe()
  return entity_info