code: def get_by_name(self, name): # pylint: disable=invalid-name,redefined-builtin
          
          rs, _ = self.list(filter=field('name').eq(name), limit=1)
          if len(rs) is 0:
              raise CDRouterError('no such device')
          return rs[0]
docs: Get a device by name.
  
          :param name: Device name as string.
          :return: :class:`devices.Device <devices.Device>` object
          :rtype: devices.Device