human
Complete the below
def locked(func):

    ''''Decorator which locks self.lock.'
    '''
 Can you provide a the Python code you requested?
assistant
#Here is the Python code you requested.
    def nested(self, *args, **kwargs):
        self.lock.acquire()
        try:
            return func(self, *args, **kwargs)
        finally:
            self.lock.release()
    return nested