@classmethod<EOL><INDENT>def requires_refcount(cls, func):<DEDENT>
@functools.wraps(func)<EOL>def requires_active_handle(*args, **kwargs):<EOL><INDENT>if cls.refcount() == <NUM_LIT:0>:<EOL><INDENT>raise NoHandleException()  <EOL><DEDENT>return func(*args, **kwargs)<EOL><DEDENT>return requires_active_handle<EOL>
The ``requires_refcount`` decorator adds a check prior to call ``func`` to verify
that there is an active handle. if there is no such handle, a ``NoHandleException`` exception is thrown.