<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def delete(query):
 """Perform DELETE query asynchronously. Returns number of rows deleted. """

    assert isinstance(query, peewee.Delete),\
        ("Error, trying to run delete coroutine"
         "with wrong query class %s" % str(query))

    cursor = await _execute_query_async(query)
    rowcount = cursor.rowcount

    await cursor.release()
    return rowcount