class_docstr: An extension for the scheduler to manage Semaphores
  
  This adds the following routes to the scheduler
  
  * semaphore_acquire
  * semaphore_release
  * semaphore_close
  * semaphore_refresh_leases
  * semaphore_register
class_docstr_tok: ["An","extension","for","the","scheduler","to","manage","Semaphores","This","adds","the","following","routes","to","the","scheduler","*","semaphore_acquire","*","semaphore_release","*","semaphore_close","*","semaphore_refresh_leases","*","semaphore_register"]
code: def _release_value(self, name, lease_id):
      logger.debug("Releasing %s for %s", lease_id, name)
      # Everything needs to be atomic here.
      del self.leases[name][lease_id]
      self.events[name].set()
      self.metrics["release_total"][name] += 1
  
imports: from __future__ import annotations
  import asyncio
  import logging
  import uuid
  import warnings
  from asyncio import TimeoutError
  from collections import defaultdict, deque
  import dask
  from dask.utils import parse_timedelta
  from distributed.compatibility import PeriodicCallback
  from distributed.metrics import time
  from distributed.utils import Deadline, SyncMethodMixin, log_errors, wait_for
  from distributed.utils_comm import retry_operation
  from distributed.worker import get_client, get_worker
label_desc: Use image node_id 8 for calling the SemaphoreExtension obj's underlying member method code with example usage: obj._release_value(name, lease_id) without return types