class_docstr: A threadsafe, singleton wrapper for time.sleep that improves accuracy.
  
  The time.sleep function is inaccurate and sometimes returns early or late. To
  improve accuracy, this class sleeps for a shorter time than requested and
  enters a spin lock for the remainder of the requested time.
  
  The offset is automatically calibrated based on when the thread is actually
  woken from sleep by increasing/decreasing the offset halfway between its
  current value and `_MIN_OFFSET`.
  
  Accurate to approximately 5ms after some initial burn-in.
  
  Args:
    initial_offset: The initial amount to shorten the time.sleep call in float
        seconds.
  Raises:
    ValueError: When `initial_offset` is less than `_MIN_OFFSET`.
docstr: Threadsafe accessor for offset attribute.
docstr_tok: ["Threadsafe","accessor","for","offset","attribute","."]
code: def offset(self):
      """Threadsafe accessor for offset attribute."""
      return self._offset
  
file_path: magenta/magenta/common/concurrency.py
imports: import functools
  import threading
  import time
label_desc: Use image node_id 2 for calling the Sleeper obj's underlying member method code with example usage: obj.offset() and returns: self