Sends new modes to or requests existing modes from the given target.
160935
def mode(self, target, mode_string=None, tags=None):
        """"""
        params = [target]
        if mode_string:
            params += mode_string
        self.send('MODE', params=params, source=self.nick, tags=tags)
993475
public void addTargetRequests(List<String> requests) {
        for (String s : requests) {
            if (StringUtils.isBlank(s) || s.equals("#") || s.startsWith("javascript:")) {
                continue;
            }
            s = UrlUtils.canonicalizeUrl(s, url.toString());
            targetRequests.add(new Request(s));
        }
    }
826295
function extend(target, source) {
  let key;
  for (key in source) {
    if (isPlainObject(source[key]) || isArray(source[key])) {
      if (isPlainObject(source[key]) && !isPlainObject(target[key])) {
        target[key] = {};
      }
      if (isArray(source[key]) && !isArray(target[key])) {
        target[key] = [];
      }
      extend(target[key], source[key]);
    } else if (source[key] !== undefined) {
      target[key] = source[key];
    }
  }
}
972301
private static Mode applyUMask(Mode mode, Mode umask) {
    mode.setOwnerBits(mode.getOwnerBits().and(umask.getOwnerBits().not()));
    mode.setGroupBits(mode.getGroupBits().and(umask.getGroupBits().not()));
    mode.setOtherBits(mode.getOtherBits().and(umask.getOtherBits().not()));
    return mode;
  }
1326831
public base_response enable_modes(String[] modes) throws Exception
	{
		base_response result = null;
		nsmode resource = new nsmode();
		resource.set_mode(modes);
		options option = new options();
		option.set_action("enable");
		result = resource.perform_operation(this, option);
		return result;
	}
925743
@MainThread
    private void scheduleActiveStatusesUpdates(EventTarget target, EventStatus status) {
        for (Event event : activeEvents) {
            for (EventMethod method : target.methods) {
                if (event.getKey().equals(method.eventKey)
                        && method.type == EventMethod.Type.STATUS) {
                    Utils.log(event.getKey(), method, "Scheduling status update for new target");
                    executionQueue.addFirst(Task.create(this, target, method, event, status));
                }
            }
        }
    }
833122
function extend(targetObj, sourceObject) {
        for (var key in sourceObject) {
            if (sourceObject.hasOwnProperty(key)) {
                targetObj[key] = sourceObject[key];
            }
        }
    }
99371
public final void addTarget(@NotNull final Target target) {
        Contract.requireArgNotNull("target", target);
        if (targets == null) {
            targets = new ArrayList<>();
        }
        targets.add(target);
    }
254701
def send(ezo, name, method, data, target):
        '''
        
        '''

        # load the contract by name
        c, err = Contract.get(name, ezo)
        if err:
            return None, err

        address, err = Contract.get_address(name, c.hash, ezo.db, target)
        if err:
            return None, err

        d = dict()
        d["address"] = address
        d["function"] = method
        d["params"] = c.paramsForMethod(method, data)
        d["target"] = target


        resp, err = c.response(d)
        if err:
            return None, err

        return resp, None
1163812
public static void sendNotification (
        ClientObject target, String receiverCode, int methodId, Object[] args)
    {
        sendNotification(target, receiverCode, methodId, args, Transport.DEFAULT);
    }
1368417
public void addChangePlayModeCommand(PlayMode playMode) {
        StringBuilder buf = new StringBuilder();
        buf.append("(change_mode ");
        buf.append(playMode);
        buf.append(')');
        fifo.add(fifo.size(), buf.toString());
    }
145028
def do_mode(self, target, msg, nick, send):
        """"""
        mode_changes = irc.modes.parse_channel_modes(msg)
        with self.data_lock:
            for change in mode_changes:
                if change[1] == 'v':
                    self.voiced[target][change[2]] = True if change[0] == '+' else False
                if change[1] == 'o':
                    self.opers[target][change[2]] = True if change[0] == '+' else False
        # reop
        # FIXME: handle -o+o msbobBot msbobBot
        if [x for x in mode_changes if self.check_mode(x)]:
            send("%s: :(" % nick, target=target)
            # Assume bot admins know what they're doing.
            if not self.is_admin(None, nick):
                send("OP %s" % target, target='ChanServ')
                send("UNBAN %s" % target, target='ChanServ')

        if len(self.guarded) > 0:
            # if user is guarded and quieted, devoiced, or deopped, fix that
            regex = r"(.*(-v|-o|\+q|\+b)[^ ]*) (%s)" % "|".join(self.guarded)
            match = re.search(regex, msg)
            if match and nick not in [match.group(3), self.connection.real_nickname]:
                modestring = "+voe-qb %s" % (" ".join([match.group(3)] * 5))
                self.connection.mode(target, modestring)
                send('Mode %s on %s by the guard system' % (modestring, target), target=self.config['core']['ctrlchan'])
320877
private void sendCommand(Collection<Address> targets, ReplicableCommand command, long requestId,
                            DeliverOrder deliverOrder, boolean rsvp, boolean checkView) {
      Objects.requireNonNull(targets);
      Message message = new Message();
      marshallRequest(message, command, requestId);
      setMessageFlags(message, deliverOrder, rsvp, true);

      if (deliverOrder == DeliverOrder.TOTAL) {
         message.dest(new AnycastAddress(toJGroupsAddressList(targets)));
         send(message);
      } else {
         Message copy = message;
         for (Iterator<Address> it = targets.iterator(); it.hasNext(); ) {
            Address address = it.next();

            if (checkView && !clusterView.contains(address))
               continue;

            if (address.equals(getAddress()))
               continue;

            copy.dest(toJGroupsAddress(address));
            send(copy);

            // Send a different Message instance to each target
            if (it.hasNext()) {
               copy = copy.copy(true);
            }
         }
      }
   }
865793
public void start(int mode) {

        final String methodName = "start";
        if (TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName);
        }

        final Set listeners;

        synchronized (ACTIVE_MESSAGING_ENGINES) {

            // Do we already have a set of active MEs on this bus?
            Set messagingEngines = (Set) ACTIVE_MESSAGING_ENGINES
                    .get(_messagingEngine.getBusName());

            // If not, create a new set and add it to the map
            if (messagingEngines == null) {

                messagingEngines = new HashSet();
                ACTIVE_MESSAGING_ENGINES.put(_messagingEngine.getBusName(),
                        messagingEngines);

            }

            // Add the activating ME to the set
            messagingEngines.add(_messagingEngine);

            // Get listeners to notify
            listeners = getListeners(_messagingEngine.getBusName());

        }

        // Notify listeners
        for (final Iterator iterator = listeners.iterator(); iterator.hasNext();) {

            final SibRaMessagingEngineListener listener = (SibRaMessagingEngineListener) iterator
                    .next();
            listener.messagingEngineStarting(_messagingEngine);

        }

        if (TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName);
        }

    }
17185
function(mode, index) {
			var keyModes = this._keyModes;
			if (index !== undefined) {
				keyModes.splice(index, 0, mode);
			} else {
				keyModes.push(mode);
			}
			//TODO: API needed for this
			if (mode._modeAdded) {
				mode._modeAdded();
			}
		}
1019554
private void pushLevel(final Mode mode) {
        JsonLevel newJsonLevel = null;

        if (mode == Mode.BOM) {
            newJsonLevel = new JsonLevel(mode, new JsonPointer()); //not a valid nesting level
        } else if (mode == Mode.JSON_OBJECT) {
            if (levelStack.size() > 0) {
                JsonLevel current = levelStack.peek();
                newJsonLevel = new JsonLevel(mode, new JsonPointer(current.jsonPointer().tokens()));
            } else {
                newJsonLevel = new JsonLevel(mode, new JsonPointer());
            }
        } else if (mode == Mode.JSON_ARRAY) {
            if (levelStack.size() > 0) {
                JsonLevel current = levelStack.peek();
                newJsonLevel = new JsonLevel(mode, new JsonPointer(current.jsonPointer().tokens()));
            } else {
                newJsonLevel = new JsonLevel(mode, new JsonPointer());
            }
            newJsonLevel.isArray(true);
            newJsonLevel.setArrayIndexOnJsonPointer();
        }

        levelStack.push(newJsonLevel);
    }
85005
final public function addNew()
    {
        $this->originalValues = null;
        $this->values = $this->emptyValuesFromDataFields();
        $this->mode = self::RSMODE_CONNECTED_ADDNEW;
    }