def _do_get_descriptor(self, user, handle):
        if user is not None:
            dev = self._session.query(Device) \
                .filter(Device.user_id == user.id) \
                .filter(Device.handle == handle).first()
        if user is None or dev is None:
            raise BadInputException('No device matches descriptor: %s' % handle)
        return dev.get_descriptor(self._metadata.get_metadata(dev))
dataset/ETHPy150Open Yubico/u2fval/u2fval/core/controller.py/U2FController._do_get_descriptor/original