def deref(o, timeout_s=None, timeout_val=None):
if isinstance(o, IDeref):<EOL><INDENT>return o.deref()<EOL><DEDENT>elif isinstance(o, IBlockingDeref):<EOL><INDENT>return o.deref(timeout_s, timeout_val)<EOL><DEDENT>raise TypeError(f"<STR_LIT>")<EOL>
Dereference a Deref object and return its contents.

    If o is an object implementing IBlockingDeref and timeout_s and
    timeout_val are supplied, deref will wait at most timeout_s seconds,
    returning timeout_val if timeout_s seconds elapse and o has not
    returned.