@gen.coroutine
def RemoveViewpoint(client, obj_store, user_id, device_id, request):
  """Remove a viewpoint from a user's inbox."""

  request['user_id'] = user_id
  viewpoint_id = request['viewpoint_id']

  # Check that the user isn't trying to remove their default viewpoint.  We do it here
  # because it saves us a query for user during the operation and the default viewpoint id
  # can't change.
  if base.ViewfinderContext.current().user.private_vp_id == viewpoint_id:
    raise PermissionError('User is not allowed to remove their default viewpoint: %s' % viewpoint_id)

  yield gen.Task(Operation.CreateAndExecute, client, user_id, device_id, 'RemoveViewpointOperation.Execute', request)

  logging.info('REMOVE VIEWPOINT: user: %d, device: %d, viewpoint: %s' % (user_id, device_id, viewpoint_id))

  raise gen.Return({})
dataset/ETHPy150Open viewfinderco/viewfinder/backend/www/service.py/RemoveViewpoint/original