def METHOD_NAME(queue, quantity=1, is_runner=False):
    """
    Pop one or more or all items from the queue return them.
    """
    cmd = "SELECT id, data FROM {}".format(queue)
    if quantity != "all":
        try:
            quantity = int(quantity)
        except ValueError as exc:
            error_txt = 'Quantity must be an integer or "all".\nError: "{}".'.format(
                exc
            )
            raise SaltInvocationError(error_txt)
        cmd = "".join([cmd, " LIMIT {};".format(quantity)])
    log.debug("SQL Query: %s", cmd)
    items = []
    with _conn(commit=True) as cur:
        cur.execute(cmd)
        result = cur.fetchall()
        if len(result) > 0:
            ids = [str(item[0]) for item in result]
            items = [item[1] for item in result]
            idlist = "','".join(ids)
            del_cmd = "DELETE FROM {} WHERE id IN ('{}');".format(queue, idlist)
            log.debug("SQL Query: %s", del_cmd)
            cur.execute(del_cmd)
    return items