<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def lock(self, resource, label='', expire=60, patience=60):
 """ Lock a resource. :param resource: String corresponding to resource type :param label: String label to attach :param expire: int seconds :param patience: int seconds """

        queue = Queue(client=self.client, resource=resource)
        with queue.draw(label=label, expire=expire) as number:
            queue.wait(number=number, patience=patience)
            yield
        queue.close()