The ``auto`` decorator wraps ``func`` in a context manager so that a handle is obtained.

        .. note::
           Please note, that most functions require the handle to continue being alive for future calls to data
           retrieved from the function. In such cases, it's advisable to use the `requires_refcount` decorator, and
           force the program using the library with obtaining a handle (and keeping it active.)

def auto(cls, func):
        """
        The ``auto`` decorator wraps ``func`` in a context manager so that a handle is obtained.

        .. note::
           Please note, that most functions require the handle to continue being alive for future calls to data
           retrieved from the function. In such cases, it's advisable to use the `requires_refcount` decorator, and
           force the program using the library with obtaining a handle (and keeping it active.)
        """
        @functools.wraps(func)
        def auto_claim_handle(*args, **kwargs):
            with cls():
                return func(*args, **kwargs)
        return auto_claim_handle