class_docstr: An extension for the scheduler to manage Locks
  
  This adds the following routes to the scheduler
  
  *  lock_acquire
  *  lock_release
class_docstr_tok: ["An","extension","for","the","scheduler","to","manage","Locks","This","adds","the","following","routes","to","the","scheduler","*","lock_acquire","*","lock_release"]
code: def release(self, name=None, id=None):
      if isinstance(name, list):
          name = tuple(name)
      if self.ids.get(name) != id:
          raise ValueError("This lock has not yet been acquired")
      del self.ids[name]
      if self.events[name]:
          self.scheduler.loop.add_callback(self.events[name][0].set)
      else:
          del self.events[name]
  
imports: from __future__ import annotations
  import asyncio
  import logging
  import uuid
  from collections import defaultdict, deque
  from dask.utils import parse_timedelta
  from distributed.utils import TimeoutError, log_errors, wait_for
  from distributed.worker import get_client
label_desc: Use image node_id 2 for calling the LockExtension obj's underlying member method code with example usage: obj.release(name, id) without return types