<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _on_disconnect(_loop, adapter, _adapter_id, conn_id):
 """Callback when a device disconnects unexpectedly."""


    conn_string = adapter._get_property(conn_id, 'connection_string')
    if conn_string is None:
        adapter._logger.debug("Dropping disconnect notification with unknown conn_id=%s", conn_id)
        return

    adapter._teardown_connection(conn_id, force=True)
    event = dict(reason='no reason passed from legacy adapter', expected=False)
    adapter.notify_event_nowait(conn_string, 'disconnection', event)