def run_callback() -> None:
    'Run callback and store result.'
    try:
        future.set_result(callback(*args))
    except Exception as exc:
        if future.set_running_or_notify_cancel():
            future.set_exception(exc)
        else:
            _LOGGER.warning('Exception on lost future: ', exc_info=True)
Run callback and store result.
def run_callback() -> None:
    
    try:
        future.set_result(callback(*args))
    except Exception as exc:
        if future.set_running_or_notify_cancel():
            future.set_exception(exc)
        else:
            _LOGGER.warning('Exception on lost future: ', exc_info=True)