if no id then it should be a server push message
168581
function processCall(msg) {
      var route = msg.route;
      if(!!route) {
        if (!!msg.body) {
          var body = msg.body.body;
          if (!body) {body = msg.body;}
          pomelo.emit(route, body);
        } else {
          pomelo.emit(route,msg);
        }
      } else {
          pomelo.emit(msg.body.route,msg.body);
      }
    }
637223
def id_(reset=False):
    '''
    
    '''
    if reset:
        id_pattern = re.compile(r'Monit id (?P<id>[^ ]+)')
        cmd = 'echo y|monit -r'
        out = __salt__['cmd.run_all'](cmd, python_shell=True)
        ret = id_pattern.search(out['stdout']).group('id')
        return ret if ret else False
    else:
        cmd = 'monit -i'
        out = __salt__['cmd.run'](cmd)
        ret = out.split(':')[-1].strip()
    return ret
374098
private void putId() {
        // note: name and info may be null
        super.put("Provider.id name", String.valueOf(name));
        super.put("Provider.id version", String.valueOf(version));
        super.put("Provider.id info", String.valueOf(info));
        super.put("Provider.id className", this.getClass().getName());
    }
779428
function NotReady(message, code_id) {
    Error.call(this);
    this.message = message || "resource is not ready yet";
    this.code_id = code_id || null;
    this.statusCode = 423;
}
699081
def publish_if_new(cls):
    """"""
    message = cls.make_message()
    if message != cls.last_message:
      super(DashboardPubSub, cls).publish(message)
      cls.last_message = message
1115110
def handle_id_request(msg):
    """"""
    node_id = msg.gateway.add_sensor()
    return msg.copy(
        ack=0, sub_type=msg.gateway.const.Internal['I_ID_RESPONSE'],
        payload=node_id) if node_id is not None else None
11234
function _pushNotifications(meta, obj, fns) {
    for (var id in meta[nfs]) {
      fns.push(function (i) {
        return function () {
          meta[nfs][i](obj);
        }
      } (id));
    }
  }
1287923
function iid(instance, id) {
  if (id)
    return fmt('svc %d.%d', instance, id);
  return fmt('svc %d.%d', instance.serverServiceId, instance.id);
}
859574
def push_build_status(id):
    
    response = utils.checked_api_call(pnc_api.build_push, 'status', build_record_id=id)
    if response:
        return utils.format_json(response)
640540
private synchronized int getNewClientID() {
        if ((clientIDGenerator + 1) >= Integer.MAX_VALUE) {
            //if we can't find a reusable ID within the first 100 slots, then fail.
            //Revisit: I don't want to loop through all 2+ billion entries to find that they are all taken, as this
            //could be seem as a DoS, but maybe some better heuristics for finding an empty ID? not sure if we will ever be
            //in this situation...
            final int limit = Integer.MIN_VALUE + 100;
            for (int i = Integer.MIN_VALUE; i < limit; i++) {
                if (inboxes.get(i) == null) {
                    return i;
                }
            }

            //Emit the warning
            Tr.warning(tc, "jmx.connector.server.rest.notification.limit.warning");

            throw ErrorHelper.createRESTHandlerJsonException(new RuntimeException("The server has reached its limit of new client notifications."),
                                                             JSONConverter.getConverter(),
                                                             APIConstants.STATUS_SERVICE_UNAVAILABLE);
        }

        return clientIDGenerator++;
    }
973852
def Message(self, Id=0):
        
        o = ChatMessage(self, Id)
        o.Status # Test if such an id is known.
        return o
545463
function(id, msg, meta) {
        var socket = openSocketsById[id];
        if (socket) {
          return socket.write('0|' + msg + '|' + meta)
        } else {
          return false;
        }
      }
771769
public Server getServerById(final String id) {
        for (Server server : SERVERS) {
            if (server.getId().equals(id)) {
                return server;
            }
        }

        return null;
    }
742551
static void checkId(String id) {
    if (!ID.matcher(id).matches()) {
      throw new IllegalArgumentException(String.format("not a valid js identifier: %s", id));
    }
  }
239685
function makeId(length = RANDOM_CHARACTER_LENGTH) {
    let text = "";
    for (let i = 0; i < length; i++) {
        text += RANDOM_CHARACTER_SOURCE.charAt(Math.floor(Math.random() * RANDOM_CHARACTER_SOURCE.length));
    }

    return text;
}
1205236
def get_id(self, request_data, parameter_name='id'):
        """"""
        if parameter_name not in request_data:
            raise ParseError("`{}` parameter is required".format(parameter_name))

        id_parameter = request_data.get(parameter_name, None)
        if not isinstance(id_parameter, int):
            raise ParseError("`{}` parameter not an integer".format(parameter_name))

        return id_parameter
212001
def _reallysend(self, payload, token, expiration=None, priority=None, identifier=None):
        

        if not self.alive:
            raise ConnectionDeadException()
        if not self.useable:
            raise ConnectionDeadException()
        seq = self._nextSeq()
        if seq >= PushConnection.MAX_PUSHES_PER_CONNECTION:
            # IDs are 4 byte so rather than worry about wrapping IDs, just make a new connection
            # Note we don't close the connection because we want to wait to see if any errors arrive
            self._retire_connection()

        payload_str = json_for_payload(truncate(payload))
        items = ''
        items += self._apns_item(PushConnection.ITEM_DEVICE_TOKEN, token)
        items += self._apns_item(PushConnection.ITEM_PAYLOAD, payload_str)
        items += self._apns_item(PushConnection.ITEM_IDENTIFIER, seq)
        if expiration:
            items += self._apns_item(PushConnection.ITEM_EXPIRATION, expiration)
        if priority:
            items += self._apns_item(PushConnection.ITEM_PRIORITY, priority)

        apnsFrame = struct.pack("!BI", PushConnection.COMMAND_SENDPUSH, len(items)) + items

        try:
            written = 0
            while written < len(apnsFrame):
                written += self.sock.send(apnsFrame[written:])
        except:
            logger.exception("Caught exception sending push")
            raise
        self.sent[seq] = PushConnection.SentMessage(
            time.time(), token, payload, expiration, priority, identifier
        )
        self.last_push_sent = time.time()