def get_flash():
  """Reads and deletes a flash message. Flash messages are stored in a cookie
  and automatically deleted when read.

  :return:
      The data stored in a flash, if any.
  """
  key = settings.FLASH_COOKIE_NAME
  data = getattr(local, 'flash_message', None)
  if data is None:
    if key in local.request.cookies:
      data = local.request.cookies[key]
  local.flash_message = None
  if data:
    return pickle.loads(b64decode(data))
  return u''
dataset/ETHPy150Open IanLewis/kay/kay/utils/flash.py/get_flash/original