any messages while some are being reallocated
337121
public synchronized void guessesInStream()  
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(this, tc, "guessesInStream", Boolean.valueOf(containsGuesses));

    containsGuesses = true;
  
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "guessesInStream", Boolean.valueOf(containsGuesses));
  }
1310789
function message(msg, rinfo) {
    self.emit('data', msg.toString().replace(/\n$/, ''), {
      port: rinfo.port,
      host: rinfo.address
    },
    rinfo.family.toLowerCase());
  }
255314
int reallocate(int offset) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.entry(this, tc, "reallocate", new Object[]{Integer.valueOf(offset)});

    byte[] oldContents = contents;
    int oldMessageOffset = messageOffset;
    contents = new byte[length];
    System.arraycopy(oldContents, messageOffset, contents, 0, length);
    tableOffset -= messageOffset;
    dataOffset -= messageOffset;
    messageOffset = 0;
    reallocated = true;
    reallocated(contents, -1);

    int result = offset - oldMessageOffset;

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.exit(this, tc, "reallocate", Integer.valueOf(result));
    return result;
  }
1289414
def decompress_messages(self, partitions_offmsgs):
        

        for pomsg in partitions_offmsgs:
            if pomsg['message']:
                pomsg['message'] = self.decompress_fun(pomsg['message'])
            yield pomsg
323542
def get_messages_since(self, cursor):
        
        results = []
        for msg in reversed(self.cache):
            if msg["id"] == cursor:
                break
            results.append(msg)
        results.reverse()
        return results
580359
public void moveMessage(boolean discard)
    throws SIMPControllableNotFoundException,
           SIMPRuntimeOperationFailedException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "moveMessage", new Object[] { Boolean.valueOf(discard) });

    assertValidControllable();

    LocalTransaction tran = _txManager.createLocalTransaction(false);
    SIMPMessage msg = null;
    try
    {
      msg = getSIMPMessage();
    }
    catch (SIResourceException e)
    {
      // No FFDC code needed    
      SIMPRuntimeOperationFailedException finalE =
        new SIMPRuntimeOperationFailedException(
          nls.getFormattedMessage(
            "INTERNAL_MESSAGING_ERROR_CWSIP0003",
            new Object[] {"QueuedMessage.moveMessage",
                          "1:473:1.66",
                          e,
                          Long.toString(_messageID)},
            null), e,
            "INTERNAL_MESSAGING_ERROR_CWSIP0003", new Object[] {Long.toString(_messageID)});
  
      SibTr.exception(tc, finalE);
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
        SibTr.exit(tc, "moveMessage", finalE);
      throw finalE;
    } 
    if(!discard)
    { 
      try
      {
        copyMessageToExceptionDestination(tran);  
      }
      catch (Exception e)
      {
        // No FFDC code needed 
        SIMPRuntimeOperationFailedException finalE =
          new SIMPRuntimeOperationFailedException(e);
        
        SibTr.exception(tc, finalE);
        
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
          SibTr.exit(tc, "moveMessage", finalE);
        throw finalE; 
      }

      discard = true;
    }
    
    if (discard)
    {      
      try
      {
        if(msg.isInStore())
        {
          if(msg.getLockID()==AbstractItem.NO_LOCK_ID)
          {
            //lock the message
            // Cache a lock ID to lock the items with          
            long lockID = _messageProcessor.getMessageStore().getUniqueLockID(AbstractItem.STORE_NEVER);
            msg.lockItemIfAvailable(lockID);
          }
          Transaction msTran = _messageProcessor.resolveAndEnlistMsgStoreTransaction(tran);
          msg.remove(msTran, msg.getLockID());  
        }
      }
      catch (Exception e)
      {
        // No FFDC code needed
        
        SIMPRuntimeOperationFailedException finalE = null;
        
        boolean adding = false;
        boolean removing = false;      
        
        if (msg instanceof MessageItem)
        {
          adding = ((MessageItem)msg).isAdding();
          removing = ((MessageItem)msg).isRemoving();
        }
        else
        {
          adding = ((MessageItemReference)msg).isAdding();
          removing = ((MessageItemReference)msg).isRemoving();          
        }
        
        if (adding)
        {
          // If the message is adding it probably means that 
          // we have an indoubt transaction which hasn't been committed
          finalE =
            new SIMPRuntimeOperationFailedException(
              nls.getFormattedMessage(
                "MESSAGE_INDOUBT_WARNING_CWSIP0361",
                new Object[] {Long.toString(_messageID),
                              _destinationHandler.getName()},
                null), 
              e,
              "MESSAGE_INDOUBT_WARNING_CWSIP0361", new Object[] {Long.toString(_messageID),
                _destinationHandler.getName() });          
        }         
        else if (removing)
        {
          // If the message is deleting it probably means that 
          // we have delivered the message to a consumer
          finalE =
            new SIMPRuntimeOperationFailedException(
              nls.getFormattedMessage(
                "MESSAGE_INDOUBT_WARNING_CWSIP0362",
                new Object[] {Long.toString(_messageID),
                              _destinationHandler.getName()},
                null), 
              e,
              "MESSAGE_INDOUBT_WARNING_CWSIP0362", new Object[] { Long.toString(_messageID),
                  _destinationHandler.getName() });          
        }         
        else
        {
          // Unexpected exception
          FFDCFilter.processException(
            e,
            "com.ibm.ws.sib.processor.runtime.QueuedMessage.moveMessage",
            "1:579:1.66",
            this);
    
          finalE =
            new SIMPRuntimeOperationFailedException(
              nls.getFormattedMessage(
                "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                new Object[] {"QueuedMessage.removeMessage",
                              "1:587:1.66",
                              e,
                              Long.toString(_messageID)},
                null), e,
                "INTERNAL_MESSAGING_ERROR_CWSIP0003", new Object[] { Long.toString(_messageID)});
        }
        
        try
        {
          tran.rollback();
        }
        catch (SIException ee)
        {
          FFDCFilter.processException(
            ee,
            "com.ibm.ws.sib.processor.runtime.QueuedMessage.moveMessage",
            "1:603:1.66",
            this);
          
          SibTr.exception(tc, ee);
        }
        

        SibTr.exception(tc, finalE);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
          SibTr.exit(tc, "moveMessage", finalE);
        throw finalE;             
      }
    }
    try
    {
      tran.commit();
    }
    catch (SIException e)
    {
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.runtime.QueuedMessage.moveMessage",
        "1:625:1.66",
        this);

      SIMPRuntimeOperationFailedException finalE =
        new SIMPRuntimeOperationFailedException(
          nls.getFormattedMessage(
            "INTERNAL_MESSAGING_ERROR_CWSIP0003",
            new Object[] {"QueuedMessage.removeMessage",
                          "1:633:1.66",
                          e,
                          Long.toString(_messageID)},
            null), e,
            "INTERNAL_MESSAGING_ERROR_CWSIP0003", new Object[] {Long.toString(_messageID)});

      SibTr.exception(tc, finalE);
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "moveMessage", finalE);
      throw finalE;
    }   
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "moveMessage"); 
  }
583038
public function clearMessages()
    {
        if (isset($this->storage[$this->storageKey])) {
            $this->storage[$this->storageKey] = [];
        }

        $this->fromPrevious = [];
        $this->forNow = [];
    }
1293106
def _pushMessages(self):
        
        # This continues to get itself called until no msgs are left in list.
        self.showStatus('')
        if len(self._statusMsgsToShow) > 0:
            self.top.after(200, self._pushMessages)
804066
def dump(self):
        
        if self._updated:
            messages = self.get_all()
            self._save(messages)

            self._lock.acquire()
            try:
                self._updated = False
                current_time = time.perf_counter() * 1000
                self._last_dump_time = current_time
            finally:
                self._lock.release()
520108
function onMessage(message) {
  if (message.command === 'run') {
    run(message.opts);
    return;
  }

  if (message.command === 'stop') {
    cleanup();
  }
}
1082851
def process_message_notification(request, messages_path):
    """"""
    if not messages_path:
        return

    global _MESSAGES_CACHE
    global _MESSAGES_MTIME

    # NOTE (lhcheng): Cache the processed messages to avoid parsing
    # the files every time. Check directory modification time if
    # reload is necessary.
    if (_MESSAGES_CACHE is None or
            _MESSAGES_MTIME != os.path.getmtime(messages_path)):
        _MESSAGES_CACHE = _get_processed_messages(messages_path)
        _MESSAGES_MTIME = os.path.getmtime(messages_path)

    for msg in _MESSAGES_CACHE:
        msg.send_message(request)
613327
def reload(self, message):
        

        self.phone = message.get('phone')
        self.level = message.get('level')
        self.utype = message.get('utype')
        self.coins = message.get('coins')
        self.wechat_id = message.get('wechat_id')
        self.coins_history = message.get('coins_history')
        self.money = message.get('money')
        self._subscribed_strategy = message.get('subuscribed_strategy')
        self._subscribed_code = message.get('subscribed_code')
        self.username = message.get('username')
        self.password = message.get('password')
        self.user_cookie = message.get('user_cookie')
        #
        portfolio_list = [item['portfolio_cookie'] for item in DATABASE.portfolio.find(
            {'user_cookie': self.user_cookie}, {'portfolio_cookie': 1, '_id': 0})]

        # portfolio_list = message.get('portfolio_list')
        if len(portfolio_list) > 0:
            self.portfolio_list = dict(
                zip(
                    portfolio_list,
                    [
                        QA_Portfolio(
                            user_cookie=self.user_cookie,
                            portfolio_cookie=item
                        ) for item in portfolio_list
                    ]
                )
            )
        else:
            self.portfolio_list = {}
1101091
def clear(self, page_size=10, vtimeout=10):
        """"""
        n = 0
        l = self.get_messages(page_size, vtimeout)
        while l:
            for m in l:
                self.delete_message(m)
                n += 1
            l = self.get_messages(page_size, vtimeout)
        return n
992779
public boolean displayMessage (ChatMessage msg, boolean alreadyDisplayed)
    {
        // see if we're full, and if so, clear out a bunch of old stuff
        int adjusted;
        if (size() == MAX_HISTORY) {
            removeRange(0, PRUNE_HISTORY);
            adjusted = PRUNE_HISTORY;

        } else {
            adjusted = 0;
        }

        // add the message to the history
        add(msg);

        // notify observers that something changed
        notify(adjusted);

        return true;
    }
745822
def older_message(m, lastm):
    ''''''
    atts = {'time_boot_ms' : 1.0e-3,
            'time_unix_usec' : 1.0e-6,
            'time_usec' : 1.0e-6}
    for a in atts.keys():
        if hasattr(m, a):
            mul = atts[a]
            t1 = m.getattr(a) * mul
            t2 = lastm.getattr(a) * mul
            if t2 >= t1 and t2 - t1 < 60:
                return True
    return False
824965
def messages(self):
        """"""

        return int(math.floor(((self.limit.unit_value - self.level) /
                               self.limit.unit_value) * self.limit.value))
992024
private void releasePendingMessage() {
        if (pendingMessage != null) {
            IRTMPEvent body = pendingMessage.getBody();
            if (body instanceof IStreamData && ((IStreamData<?>) body).getData() != null) {
                ((IStreamData<?>) body).getData().free();
            }
            pendingMessage = null;
        }
    }