def __call__(self, method):
        """
        Sets up the decorated method

        :param method: The decorated method
        :return: The wrapped method
        """

        @functools.wraps(method)
        def wrapped(*args, **kwargs):
            """
            The wrapping method
            """
            with self.__lock:
                return method(*args, **kwargs)

        return wrapped
def __call__ ( self , method ) : @ functools . wraps ( method ) def wrapped ( * args , ** kwargs ) : with self . __lock : return method ( * args , ** kwargs ) return wrapped
Sets up the decorated method

        :param method: The decorated method
        :return: The wrapped method