code: def _timeout_generator(
      self,
      timeout: typing.Optional[float],
      check_interval: typing.Optional[float],
  ) -> typing.Iterator[int]:
      f_timeout = coalesce(timeout, self.timeout, 0.0)
      f_check_interval = coalesce(
          check_interval, self.check_interval, 0.0
      )
  
      yield 0
      i = 0
  
      start_time = time.perf_counter()
      while start_time + f_timeout > time.perf_counter():
          i += 1
          yield i
  
          # Take low lock checks into account to stay within the interval
          since_start_time = time.perf_counter() - start_time
          time.sleep(
              max(0.001, (i * f_check_interval) - since_start_time)
          )
  
imports: import abc
  import atexit
  import contextlib
  import logging
  import os
  import pathlib
  import random
  import tempfile
  import time
  import typing
  import warnings
  from .None import constants, exceptions, portalocker
label_desc: Use image node_id 3 for calling the LockBase obj's underlying member method code with example usage: obj._timeout_generator(timeout, check_interval) without return types