class_docstr: Base Rate Limiter class for both sync and async versions.
code: def _acquire_request_slot_gen(self):
      # Requests rate is limited by `min_delay_seconds` interval.
      #
      # Imagine the time axis as a grid with `min_delay_seconds` step,
      # where we would call each step as a "request slot". RateLimiter
      # guarantees that each "request slot" contains at most 1 request.
      #
      # Note that actual requests might take longer time than
      # `min_delay_seconds`. In that case you might want to consider
      # parallelizing requests (with a ThreadPool for sync mode and
      # asyncio tasks for async), to keep the requests rate closer
      # to `min_delay_seconds`.
      #
      # This generator thread-safely acquires a "request slot", and
      # if it fails to do that at this time, it yields the amount
      # of seconds to sleep until the next attempt. The generator
      # stops only when the "request slot" has been successfully
      # acquired.
      #
      # There's no ordering between the concurrent requests. The first
      # request to acquire the lock wins the next "request slot".
      while True:
          with self._lock:
              clock = self._clock()
              if self._last_call is None:
                  # A first iteration -- start immediately.
                  self._last_call = clock
                  return
              seconds_since_last_call = clock - self._last_call
              wait = self.min_delay_seconds - seconds_since_last_call
              if wait <= 0:
                  # A successfully acquired request slot.
                  self._last_call = clock
                  return
          # Couldn't acquire a request slot. Wait until the beginning
          # of the next slot to try again.
          yield wait
  
imports: import asyncio
  import inspect
  import threading
  from itertools import chain, count
  from time import sleep
  from timeit import default_timer
  from geopy.exc import GeocoderServiceError
  from geopy.util import logger
label_desc: Use image node_id 3 for calling the BaseRateLimiter obj's underlying member method code with example usage: obj._acquire_request_slot_gen() without return types