Modification Operations
552662
public boolean put(K key, V value)
    {
        C collection = this.getIfAbsentPutCollection(key);

        if (collection.add(value))
        {
            this.incrementTotalSize();
            return true;
        }
        return false;
    }
960203
def _add_modification_to_agent(agent, mod_type, residue, position):
    """"""
    new_mod = ModCondition(mod_type, residue, position)
    # Check if this modification already exists
    for old_mod in agent.mods:
        if old_mod.equals(new_mod):
            return agent
    new_agent = deepcopy(agent)
    new_agent.mods.append(new_mod)
    return new_agent
1135491
protected void modified(Map<?, ?> properties) {
        if (properties instanceof Dictionary) {
            processConfig((Dictionary<?, ?>) properties);
        } else {
            Dictionary<?, ?> newconfig = new Hashtable<Object, Object>(properties);
            processConfig(newconfig);
        }
    }
796446
def modify(self, modification, parameters):
        
        for src in self:
            src.modify(modification, parameters)
963581
def modifie(self, key: str, value: Any) -> None:
        """"""
        if key in self.FIELDS_OPTIONS:
            self.modifie_options(key, value)
        else:
            self.modifications[key] = value
834278
private CompletableFuture<Void> modifyColumns(ModifyTableBuilder modifications) {
    return toCompletableFuture(bigtableTableAdminClient
        .modifyFamiliesAsync(modifications.build()))
        .thenApply(r -> null);
  }
210066
function modifiedGramSchmidt (m) {
  const n = m.dimension;

  const v0 = m.getColumn(0);
  const u0 = v0;
  const v1 = m.getColumn(1);
  const u1 = v1.clone().sub(proj(u0, v1));
  if (n === 2) {
    m.setColumns(v0, v1);
    return;
  }
  const v2 = m.getColumn(2);
  const u2t = v2.clone().sub(proj(u0, v2));
  const u2 = u2t.sub(proj(u1, u2t));
  if (n === 3) {
    m.setColumns(u0, u1, u2);
    // return;
  }
}
521566
function it_should_generate_add_and_remove_operations_on_a_modify_operation($connection, BatchModifyOperation $operation)
    {
        $sid = 'S-1-5-21-1004336348-1177238915-682003330-512';
        $sidHex = '\01\05\00\00\00\00\00\05\15\00\00\00\dc\f4\dc\3b\83\3d\2b\46\82\8b\a6\28\00\02\00\00';
        $guid = 'a1131cd3-902b-44c6-b49a-1f6a567cda25';
        $guidHex = '\d3\1c\13\a1\2b\90\c6\44\b4\9a\1f\6a\56\7c\da\25';
        $dn = 'cn=foo,dc=example,dc=local';
        $objectDn = 'CN=SomeGroup,OU=Employees,DC=example,DC=com';
        $ldapObject = new LdapObject(['dn' => $objectDn], 'group');

        $connection->execute(Argument::that(function($operation) {
            return $operation->getFilter() == '(&(&(objectClass=bar))(sAMAccountName=Foo))';
        }))->willReturn($this->entry);
        $connection->execute(Argument::that(function($operation) use ($guid, $guidHex) {
            return $operation->getFilter() == '(&(&(objectClass=bar))(|(objectGuid='.$guidHex.')(sAMAccountName='.$guid.')))';
        }))->willReturn($this->entryGuid);
        $connection->execute(Argument::that(function($operation) use ($sid, $sidHex) {
            return $operation->getFilter() == '(&(&(objectClass=bar))(|(objectSid='.$sidHex.')(sAMAccountName='.$sid.')))';
        }))->willReturn($this->entrySid);

        $this->setOperation($operation);
        $this->setOperationType(AttributeConverterInterface::TYPE_MODIFY);
        $this->setDn($dn);

        $nameDn = $this->entry[0]['distinguishedname'][0];
        $guidDn = $this->entryGuid[0]['distinguishedname'][0];
        $sidDn = $this->entrySid[0]['distinguishedname'][0];

        $batchAdd1 = new Batch(Batch::TYPE['ADD'], 'member', 'Foo');
        $batchAdd2 = new Batch(Batch::TYPE['REMOVE'], 'member', $sid);
        $batchRemove = new Batch(Batch::TYPE['ADD'], 'member', [$guid, $ldapObject]);

        // Expected actions for the add batch...
        $this->setBatch($batchAdd1);
        $operation->addPostOperation(Argument::that(function ($op) use ($batchAdd1, $nameDn, $dn) {
            $batches = [new Batch(Batch::TYPE['ADD'], 'member', [$dn])];

            return $op instanceof BatchModifyOperation
                && $op->getBatchCollection()->toArray() == $batches
                && $op->getBatchCollection()->getDn() == $nameDn;
        }))->shouldBeCalled();
        $this->toLdap(['Foo'])->shouldBeArray();

        // Expected actions for the remove batch...
        $this->setBatch($batchRemove);
        $operation->addPostOperation(Argument::that(function ($op) use ($batchRemove, $sidDn, $dn) {
            $batches = [new Batch($batchRemove->getModType(), 'member', [$dn])];

            return $op instanceof BatchModifyOperation
            && $op->getBatchCollection()->toArray() == $batches
            && $op->getBatchCollection()->getDn() == $sidDn;
        }))->shouldBeCalled();
        $this->toLdap([$sid])->shouldBeArray();

        // Expected actions for the multi-add batch...
        $this->setBatch($batchAdd2);
        foreach ([$guidDn, $objectDn] as $value) {
            $operation->addPostOperation(Argument::that(function ($op) use ($batchAdd2, $value, $dn) {
                $batches = [new Batch($batchAdd2->getModType(), 'member', [$dn])];

                return $op instanceof BatchModifyOperation
                    && $op->getBatchCollection()->toArray() == $batches
                    && $op->getBatchCollection()->getDn() == $value;
            }))->shouldBeCalled();
        }
        $this->toLdap([$guid, $ldapObject])->shouldBeArray();
    }
75285
void processOperation(HierarchyWrapperOperation operation) {
        // Hook for start
        operation.startOfProcess();

        // Hook to process other content (newlines and comments)
        otherContentList.forEach(operation::processOtherContent);

        if (elementContent != null && elementContent.isContentElement()) {
            // Hook to process element
            operation.processElement(elementContent);
        }

        // Hook to manipulate the order of the children
        operation.manipulateChildElements(children);

        // Hook to modify the operation before traversing sub levels
        HierarchyWrapperOperation subOperation = operation.createSubOperation();

        for (HierarchyWrapper child : children) {
            child.processOperation(subOperation);
        }

        // Hook for end of process
        operation.endOfProcess();
    }
350030
public static admin_ns_config modify(nitro_service client, admin_ns_config resource) throws Exception
	{
		resource.validate("modify");
		return ((admin_ns_config[]) resource.update_resource(client))[0];
	}
208078
def apply_operation(op_stack, out_stack):
    
    out_stack.append(calc(out_stack.pop(), out_stack.pop(), op_stack.pop()))
814593
private void modify(Set<Permission> permissions, IResource resource, String user, String op) throws RequestExecutionException
    {
        process(String.format("UPDATE %s.%s SET permissions = permissions %s {%s} WHERE username = '%s' AND resource = '%s'",
                              Auth.AUTH_KS,
                              PERMISSIONS_CF,
                              op,
                              "'" + StringUtils.join(permissions, "','") + "'",
                              escape(user),
                              escape(resource.getName())));
    }
946258
def _modify(self, **patch):
        """"""
        if 'state' in patch:
            if patch['state'] != 'user-up' and patch['state'] != 'user-down':
                msg = "The members resource does not support a modify with " \
                      "the value of the 'state' attribute as %s. " \
                      "The accepted values are 'user-up' or " \
                      "'user-down'" % patch['state']
                raise MemberStateModifyUnsupported(msg)
        if 'session' in patch:
            if patch['session'] != 'user-enabled' and patch['session'] != \
                    'user-disabled':
                msg = "The members resource does not support a modify with " \
                      "the value of the 'session' attribute as %s. " \
                      "The accepted values are 'user-enabled' or " \
                      "'user-disabled'" % patch['session']
                raise MemberStateModifyUnsupported(msg)
        super(Members, self)._modify(**patch)
813576
void modifyData(final TrieNode<V> node, final V value) {
        node.value = value;
        ++modCount;
        ++size;
    }
1169998
function modify(modifier, source, index, shift) {
  if (
    !this.isEnabled() &&
    source === Emitter.sources.USER &&
    !this.allowReadOnlyEdits
  ) {
    return new Delta();
  }
  let range = index == null ? null : this.getSelection();
  const oldDelta = this.editor.delta;
  const change = modifier();
  if (range != null) {
    if (index === true) {
      index = range.index; // eslint-disable-line prefer-destructuring
    }
    if (shift == null) {
      range = shiftRange(range, change, source);
    } else if (shift !== 0) {
      range = shiftRange(range, index, shift, source);
    }
    this.setSelection(range, Emitter.sources.SILENT);
  }
  if (change.length() > 0) {
    const args = [Emitter.events.TEXT_CHANGE, change, oldDelta, source];
    this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);
    if (source !== Emitter.sources.SILENT) {
      this.emitter.emit(...args);
    }
  }
  return change;
}
1121991
def modify(self, **params):
        """"""
        data = self.api_client.update_current_user(**params)
        self.update(data)
        return data
1067591
def modify(name, old_value, new_value)
      @attributes[name] = new_value
      if @modifications && (old_value != new_value)
        original = @modifications[name].first if @modifications[name]
        @modifications[name] = [ (original || old_value), new_value ]
      end
    end