def METHOD_NAME(pi_cls):
    """Wrap a python class as pass instrument"""
    # No additional wrapping needed if the user class already
    # inherits.
    if issubclass(pi_cls, PassInstrument):
        return pi_cls
    class PyPassInstrument(pi_cls, PassInstrument):
        """Internal wrapper class to create a class instance."""
        def __init__(self, *args, **kwargs):
            # initialize handle in case pi_cls creation failed.
            self.handle = None
            pi_cls.__init__(self, *args, **kwargs)
            PassInstrument.__init__(self)
    functools.update_wrapper(PyPassInstrument.__init__, pi_cls.__init__)
    PyPassInstrument.__name__ = pi_cls.__name__
    PyPassInstrument.__doc__ = pi_cls.__doc__
    PyPassInstrument.__module__ = pi_cls.__module__
    return PyPassInstrument