Monitor devices
To be notified when new Devices are added or existing Devices are removed, use InputSystem.onDeviceChange.
Warning
It looks like the sample you are looking for does not exist.
InputSystem.onDeviceChange delivers notifications for other device-related changes as well. See the InputDeviceChange enum for more information.