<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def execute_proc(procname, args=()):
 """ Execute a stored procedure. Returns the number of affected rows. """

    ctx = Context.current()
    with ctx.mdr:
        cursor = ctx.execute_proc(procname, args)
        row_count = cursor.rowcount
        _safe_close(cursor)
    return row_count