Extracts path attributes from the given UPDATE message and checks
        if the given attributes have loops or not.

        :param update_msg: UPDATE message instance.
        :return: True if attributes have loops. Otherwise False.
348673
def _is_looped_path_attrs(self, update_msg):
        
        umsg_pattrs = update_msg.pathattr_map
        recv_open_msg = self.protocol.recv_open_msg

        # Check if AS_PATH has loops.
        aspath = umsg_pattrs.get(BGP_ATTR_TYPE_AS_PATH)
        if (aspath is not None
                and aspath.has_local_as(
                    self.local_as,
                    max_count=self._common_conf.allow_local_as_in_count)):
            LOG.error(
                'AS_PATH on UPDATE message has loops. '
                'Ignoring this message: %s',
                update_msg)
            return

        # Check if ORIGINATOR_ID has loops. [RFC4456]
        originator_id = umsg_pattrs.get(BGP_ATTR_TYPE_ORIGINATOR_ID, None)
        if (originator_id
                and recv_open_msg.bgp_identifier == originator_id):
            LOG.error(
                'ORIGINATOR_ID on UPDATE message has loops. '
                'Ignoring this message: %s',
                update_msg)
            return

        # Check if CLUSTER_LIST has loops. [RFC4456]
        cluster_list = umsg_pattrs.get(BGP_ATTR_TYPE_CLUSTER_LIST, None)
        if (cluster_list
                and self._common_conf.cluster_id in cluster_list.value):
            LOG.error(
                'CLUSTER_LIST on UPDATE message has loops. '
                'Ignoring this message: %s', update_msg)
            return
1358861
async def message_fields(self, msg, fields, obj=None):
        
        for field in fields:
            await self.message_field(msg, field, obj)
        return msg
523360
def has_update(self):
        
        _time = time
        if _time() > self.next_update:
            self.update_data()
            self.next_update = _time() + self.interval
            return True
        return False
1240489
public boolean evaluateMessage(
    Selector selectorTree,
    Selector discriminatorTree,
    SIBusMessage msg)
  { 
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "evaluateMessage", new Object[] { selectorTree, discriminatorTree, msg });

    boolean ret = mpm.evaluateMessage(selectorTree, discriminatorTree, msg );
          
    if (tc.isEntryEnabled()) SibTr.exit(tc, "evaluateMessage", new Boolean(ret));
    return ret;             
  }
161644
def _has_skip(self, msg):
        '''
        
        '''
        for skip in self.skips:
            if re.search(skip, msg):
                return True
        return False
998287
def _extract_and_reconstruct_as_path(self, update_msg):
        """"""
        umsg_pattrs = update_msg.pathattr_map

        as_aggregator = umsg_pattrs.get(BGP_ATTR_TYPE_AGGREGATOR, None)
        as4_aggregator = umsg_pattrs.get(BGP_ATTR_TYPE_AS4_AGGREGATOR, None)
        if as_aggregator and as4_aggregator:
            # When both AGGREGATOR and AS4_AGGREGATOR are received,
            # if the AS number in the AGGREGATOR attribute is not AS_TRANS,
            # then:
            #  -  the AS4_AGGREGATOR attribute and the AS4_PATH attribute SHALL
            #     be ignored,
            #  -  the AGGREGATOR attribute SHALL be taken as the information
            #     about the aggregating node, and
            #  -  the AS_PATH attribute SHALL be taken as the AS path
            #     information.
            if as_aggregator.as_number != bgp.AS_TRANS:
                update_msg.path_attributes.remove(as4_aggregator)
                as4_path = umsg_pattrs.pop(BGP_ATTR_TYPE_AS4_PATH, None)
                if as4_path:
                    update_msg.path_attributes.remove(as4_path)
            # Otherwise,
            #  -  the AGGREGATOR attribute SHALL be ignored,
            #  -  the AS4_AGGREGATOR attribute SHALL be taken as the
            #     information about the aggregating node, and
            #  -  the AS path information would need to be constructed,
            #     as in all other cases.
            else:
                update_msg.path_attributes.remove(as_aggregator)
                update_msg.path_attributes.remove(as4_aggregator)
                update_msg.path_attributes.append(
                    bgp.BGPPathAttributeAggregator(
                        as_number=as4_aggregator.as_number,
                        addr=as4_aggregator.addr,
                    )
                )

        as_path = umsg_pattrs.get(BGP_ATTR_TYPE_AS_PATH, None)
        as4_path = umsg_pattrs.get(BGP_ATTR_TYPE_AS4_PATH, None)
        if as_path and as4_path:
            # If the number of AS numbers in the AS_PATH attribute is
            # less than the number of AS numbers in the AS4_PATH attribute,
            # then the AS4_PATH attribute SHALL be ignored, and the AS_PATH
            # attribute SHALL be taken as the AS path information.
            if as_path.get_as_path_len() < as4_path.get_as_path_len():
                update_msg.path_attributes.remove(as4_path)

            # If the number of AS numbers in the AS_PATH attribute is larger
            # than or equal to the number of AS numbers in the AS4_PATH
            # attribute, then the AS path information SHALL be constructed
            # by taking as many AS numbers and path segments as necessary
            # from the leading part of the AS_PATH attribute, and then
            # prepending them to the AS4_PATH attribute so that the AS path
            # information has a number of AS numbers identical to that of
            # the AS_PATH attribute.
            else:
                update_msg.path_attributes.remove(as_path)
                update_msg.path_attributes.remove(as4_path)
                as_path = self._construct_as_path_attr(as_path, as4_path)
                update_msg.path_attributes.append(as_path)
390763
def logGPMsg(self, printMsg=True):
        
        from arcpy import GetMessages

        msgs = GetMessages()
        try:
            self.logMsg(msgs, printMsg)
        except:
            self.logMsg('error getting arcpy message', printMsg)
20528
public boolean commitInsert(MessageItem msg) throws SIResourceException
  {   
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "commitInsert", msg); 
    boolean updated = updateSourceStream(msg, false);
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "commitInsert", new Boolean(updated));
    return updated;
  }
231693
def process_messages_loop(self):
        
        self.receiving_messages = True
        try:
            self.process_messages_loop_internal()
        except pika.exceptions.ConnectionClosed as ex:
            logging.error("Connection closed {}.".format(ex))
            raise
1363309
def _do_update_callback(self, msg):
        """"""
        for callback, device in self._update_callbacks:
            if device == msg:
                _LOGGER.debug('Update callback %s for device %s by %s',
                              callback, device, msg)
                self._event_loop.call_soon(callback, msg)
63033
async def message(self, msg, msg_type=None, use_version=None):
        
        elem_type = msg_type if msg_type is not None else msg.__class__
        version = await self.version(elem_type, None, elem=msg) if use_version is None else use_version

        if self.is_tracked():
            return self.get_tracked()

        if hasattr(elem_type, 'boost_serialize'):
            msg = elem_type() if msg is None else msg
            self.pop_track(use_version is None)
            return await msg.boost_serialize(self, version=version)

        if self.writing:
            self.pop_track(use_version is None)
            return await self.dump_message(msg, msg_type=msg_type)
        else:
            obj = await self.load_message(msg_type, msg=msg)
            return self.track_obj(obj, use_version is None)
446991
function checkMsg(msg, protos){
    if(!protos){
      return false;
    }

    for(var name in protos){
      var proto = protos[name];

      //All required element must exist
      switch(proto.option){
        case 'required' :
          if(typeof(msg[name]) === 'undefined'){
            return false;
          }
        case 'optional' :
          if(typeof(msg[name]) !== 'undefined'){
            if(!!protos.__messages[proto.type]){
              checkMsg(msg[name], protos.__messages[proto.type]);
            }
          }
        break;
        case 'repeated' :
          //Check nest message in repeated elements
          if(!!msg[name] && !!protos.__messages[proto.type]){
            for(var i = 0; i < msg[name].length; i++){
              if(!checkMsg(msg[name][i], protos.__messages[proto.type])){
                return false;
              }
            }
          }
        break;
      }
    }

    return true;
  }
351167
def copy_update(pb_message, **kwds):
    
    result = pb_message.__class__()
    result.CopyFrom(pb_message)
    for k, v in kwds.items():
        setattr(result, k, v)
    return result
1165807
def obj_python_attrs(msg_):
    

    # a special case for namedtuple which seems widely used in
    # ofp parser implementations.
    if hasattr(msg_, '_fields'):
        for k in msg_._fields:
            yield(k, getattr(msg_, k))
        return
    base = getattr(msg_, '_base_attributes', [])
    opt = getattr(msg_, '_opt_attributes', [])
    for k, v in inspect.getmembers(msg_):
        if k in opt:
            pass
        elif k.startswith('_'):
            continue
        elif callable(v):
            continue
        elif k in base:
            continue
        elif hasattr(msg_.__class__, k):
            continue
        yield (k, v)
215716
public boolean rm(Msg msg, Pipe pipe)
    {
        assert (msg != null);
        assert (pipe != null);
        return rmHelper(msg, 1, msg.size() - 1, pipe);
    }
300865
def check_new_messages(client_id):
    
    # Return if driver is not defined or if whatsapp is not logged in.
    # Stop the timer as well
    if client_id not in drivers or not drivers[client_id] or not drivers[client_id].is_logged_in():
        timers[client_id].stop()
        return

    # Acquire a lock on thread
    if not acquire_semaphore(client_id, True):
        return

    try:
        # Get all unread messages
        res = drivers[client_id].get_unread()
        # Mark all of them as seen
        for message_group in res:
            message_group.chat.send_seen()
        # Release thread lock
        release_semaphore(client_id)
        # If we have new messages, do something with it
        if res:
            print(res)
    except:
        pass
    finally:
        # Release lock anyway, safekeeping
        release_semaphore(client_id)
1089790
async def message(self, msg, msg_type=None, use_version=None):
        
        elem_type = msg_type if msg_type is not None else msg.__class__
        msg = elem_type() if msg is None else msg
        if hasattr(elem_type, "serialize_archive"):
            version = await self.version(elem_type, None, elem=msg) if use_version is None else use_version
            return await msg.serialize_archive(self, version=version)

        mtype = msg.__class__ if msg_type is None else msg_type
        fields = mtype.f_specs()
        if hasattr(mtype, "serialize_archive"):
            raise ValueError("Cannot directly load, has to use archive with %s" % mtype)

        await self.message_fields(msg, fields)
        return msg