<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_scan(self, info):
 """Callback called when a new device is discovered on this CMDStream Args: info (dict):
 Information about the scanned device """


        device_id = info['uuid']
        expiration_time = info.get('validity_period', 60)
        infocopy = deepcopy(info)

        infocopy['expiration_time'] = monotonic() + expiration_time

        with self._scan_lock:
            self._scanned_devices[device_id] = infocopy