code: def manage_work_queue(queue_name):
      
      modify_form = forms.ModifyWorkQueueTaskForm()
      if modify_form.validate_on_submit():
          primary_key = (modify_form.task_id.data, queue_name)
          task = work_queue.WorkQueue.query.get(primary_key)
          if task:
              logging.info('Action: %s task_id=%r',
                           modify_form.action.data, modify_form.task_id.data)
              if modify_form.action.data == 'retry':
                  task.status = work_queue.WorkQueue.LIVE
                  task.lease_attempts = 0
                  task.heartbeat = 'Retrying ...'
                  db.session.add(task)
              else:
                  db.session.delete(task)
              db.session.commit()
          else:
              logging.warning('Could not find task_id=%r to delete',
                              modify_form.task_id.data)
          return redirect(url_for('manage_work_queue', queue_name=queue_name))
  
      query = (
          work_queue.WorkQueue.query
          .filter_by(queue_name=queue_name)
          .order_by(work_queue.WorkQueue.created.desc()))
  
      status = request.args.get('status', '', type=str).lower()
      if status in work_queue.WorkQueue.STATES:
          query = query.filter_by(status=status)
      else:
          status = None
  
      item_list = list(query.limit(100))
      work_list = []
      for item in item_list:
          form = forms.ModifyWorkQueueTaskForm()
          form.task_id.data = item.task_id
          form.delete.data = True
          work_list.append((item, form))
  
      context = dict(
          queue_name=queue_name,
          status=status,
          work_list=work_list,
      )
      return render_template('view_work_queue.html', **context)
docs: Page for viewing the contents of a work queue.