Get a device by name.

        :param name: Device name as string.
        :return: :class:`devices.Device <devices.Device>` object
        :rtype: devices.Device

def get_by_name(self, name): # pylint: disable=invalid-name,redefined-builtin
        """Get a device by name.

        :param name: Device name as string.
        :return: :class:`devices.Device <devices.Device>` object
        :rtype: devices.Device
        """
        rs, _ = self.list(filter=field('name').eq(name), limit=1)
        if len(rs) is 0:
            raise CDRouterError('no such device')
        return rs[0]