Handle an item.

        This just loops through the handlers offering them the record
        to handle.
966495
def handle(self, record):
        
        record = self.prepare(record)
        for handler in self.handlers:
            handler(record)
239245
def handle_data(self, data):
        """"""
        if 'id' in data:
            self.handle_response(data)
        else:
            self.handle_notification(data)
1044378
def handle(self, msg_type):
        

        def wrap(callback):
            self._handlers[msg_type] = callback
            return callback

        return wrap
165752
def handleClick(self, item, column):
        
        if item.text(0) == 'add another item':
            new_item = self.addEntry()
            self.setCurrentItem(new_item, 1)
            self.editItem(new_item, 1)
        
        elif column == 0:
            self.takeTopLevelItem(self.indexOfTopLevelItem(item))
803483
def handle(item)
      case item
      when "WEIGHTS"
        self.type = :weights
        self.weights = []
      when "AGGREGATE"
        self.type = :aggregate
      when nil
        # This should never be called, raise a syntax error if we manage to hit it
        raise(Redis::CommandError, "ERR syntax error")
      else
        send "handle_#{type}", item
      end
      self
    end
300389
def from_record(self, record):
        
        kwargs = self.get_field_kwargs(record)
        return self.sequenced_item_class(**kwargs)
57492
def handle(self, event):
        
        callback = getattr(self, 'on_{event}'.format(event=event.event), None)
        callback(event)
1353933
protected void handleItemClick(Object itemId) {

        Item item = getItem(itemId);
        I_CmsOuTreeType type = (I_CmsOuTreeType)getItem(itemId).getItemProperty(PROP_TYPE).getValue();
        CmsUUID roleOrGroupID = null;
        boolean idInItem = false;
        if (itemId instanceof CmsUUID) {
            roleOrGroupID = (CmsUUID)itemId;
            idInItem = true;
        } else if (item.getItemProperty(PROP_SID).getValue() != null) {
            roleOrGroupID = (CmsUUID)(item.getItemProperty(PROP_SID).getValue());
            idInItem = true;
        }
        if (type.equals(CmsOuTreeType.ROLE)) {
            String ou = getOuFromItem(itemId, CmsOuTreeType.ROLE);
            boolean isRoot = ou.isEmpty();
            if (isRoot) {
                ou = "/";
            }
            if (!((String)itemId).endsWith(ou)) {
                if (isRoot) {
                    if (((String)itemId).length() > (ou.length() + 1)) {
                        roleOrGroupID = new CmsUUID(((String)itemId).substring(ou.length() + 1));
                    }
                } else {
                    roleOrGroupID = new CmsUUID(((String)itemId).substring(ou.length() + 2));
                }
            }
        }

        m_app.update(getOuFromItem(itemId, type), type, roleOrGroupID, "");
        if (isExpanded(itemId) || idInItem) {
            return;
        }
        loadAndExpand(itemId, type);
        setValue(itemId);

    }
1092726
def handle(self):
        
        # Unpack the data from the request
        data, socket = self.request
        
        try:
            # Parse it as JSON
            message_attrs = json.loads(data.decode('utf-8'))
            # Fluff it up into a proper logging record
            record = logging.makeLogRecord(message_attrs)
        except:
            # Complain someone is sending us bad logging data
            logging.error("Malformed log message from {}".format(self.client_address[0]))
        else:
            # Log level filtering should have been done on the remote end. The handle() method
            # skips it on this end.
            log.handle(record)
507053
def handle(self):
        
        logger = StreamHandler.logger
        logger.debug("handling requests with message handler %s " % StreamHandler.message_handler.__class__.__name__)

        message_handler = StreamHandler.message_handler

        try:
            while True:
                logger.debug('waiting for more data')
                if not message_handler.handle(self.request, StreamHandler.BUFFER_SIZE):
                    break

            logger.warning("connection closed from %s" % (self.client_address[0]))
            self.request.close()
        except:
            logger.exception("connection closed from %s" % (self.client_address[0]))
        finally:
            self.request.close()
1302080
def sync_with_handlers(self, handlers=()):
        '''
        
        '''
        if not handlers:
            return

        while self.__messages:
            record = self.__messages.pop(0)
            for handler in handlers:
                if handler.level > record.levelno:
                    # If the handler's level is higher than the log record one,
                    # it should not handle the log record
                    continue
                handler.handle(record)
1209779
def move_item_up(self, item):
        
        prev_iter = self._prev_iter_for(item)
        if prev_iter is not None:
            self.model.swap(prev_iter, self._iter_for(item))
1331505
def handle_document(self, item_session: ItemSession, filename: str) -> Actions:
        '''
        '''
        self._waiter.reset()

        action = self.handle_response(item_session)

        if action == Actions.NORMAL:
            self._statistics.increment(item_session.response.body.size())
            item_session.set_status(Status.done, filename=filename)

        return action
796649
def on_records(self, records):
        
        handler = self.handlers.get("on_records")
        if callable(handler):
            handler(records)
1284781
async def handle(self, record: LogRecord) -> bool:  # type: ignore
        
        rv = self.filter(record)
        if rv:
            await self.emit(record)
        return rv
231563
def handle(job_id, log_level='info', log_file=None):
    
    handlers = [LogDatabaseHandler(job_id)]  # log on db always
    if log_file is None:
        # add a StreamHandler if not already there
        if not any(h for h in logging.root.handlers
                   if isinstance(h, logging.StreamHandler)):
            handlers.append(LogStreamHandler(job_id))
    else:
        handlers.append(LogFileHandler(job_id, log_file))
    for handler in handlers:
        logging.root.addHandler(handler)
    init(job_id, LEVELS.get(log_level, logging.WARNING))
    try:
        yield
    finally:
        # sanity check to make sure that the logging on file is working
        if (log_file and log_file != os.devnull and
                os.path.getsize(log_file) == 0):
            logging.root.warn('The log file %s is empty!?' % log_file)
        for handler in handlers:
            logging.root.removeHandler(handler)
110079
function processItemprop(item, processedItems) {
  var property, value, itemtypeHtml, currentItem;

  itemtypeHtml = $(item).parents("[itemtype]").html();

  if (itemtypeHtml) {
    property = $(item).attr('itemprop');
    value    = getPropValue(item);

    currentItem   = arraySearch(processedItems, md5(itemtypeHtml));

    if (currentItem.properties[property]) {
      if (!Array.isArray(currentItem.properties[property])) {
        currentItem.properties[property] = [currentItem.properties[property]];
      }
      currentItem.properties[property].push(value);
    } else {
      currentItem.properties[property] = value;
    }
  }
}