Add a modification condition to an Agent.
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
189698
public void addCondition(final Condition condition) {
        if (conditions_ == null) {
            conditions_ = new ArrayList<>();
        }
        conditions_.add(condition);
    }
950990
def qteModificationChanged(self, mod):
        
        if mod:
            s = '*'
        else:
            s = '-'
        self._qteModeBar.qteChangeModeValue('MODIFIED', s)
1351209
public void add(final Condition condition) {
        if (andConditions.isEmpty()) {
            andConditions.add(new AndCondition());
        }
        andConditions.get(0).getConditions().add(condition);
    }
18598
def agent_version(self, value):
        
        if value == self._defaults['ai.internal.agentVersion'] and 'ai.internal.agentVersion' in self._values:
            del self._values['ai.internal.agentVersion']
        else:
            self._values['ai.internal.agentVersion'] = value
1236521
def add_alias(agent, prefix, alias):
    """"""
    return _broadcast(agent, AddMappingManager, RecordType.record_CNAME,
                      prefix, alias)
1275779
public void addModifier(String modifier) {
		if (!Strings.isEmpty(modifier)) {
			this.sarlAgent.getModifiers().add(modifier);
		}
	}
161796
def modify(self, **kwargs):
        """"""
        self._check_exclusive_parameters(**kwargs)
        return super(Rule, self)._modify(**kwargs)
15909
def _add_rule(self, group, role, value):
        """"""
        if role not in group:
            group[role] = list()

        group[role].append(value)

        self.invalidate()
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)
1288309
def get_create_base_agent(self, agent):
        """"""
        try:
            base_agent = self.agents[_n(agent.name)]
        except KeyError:
            base_agent = BaseAgent(_n(agent.name))
            self.agents[_n(agent.name)] = base_agent

        # If it's a molecular agent
        if isinstance(agent, Agent):
            # Handle bound conditions
            for bc in agent.bound_conditions:
                bound_base_agent = self.get_create_base_agent(bc.agent)
                bound_base_agent.create_site(get_binding_site_name(agent))
                base_agent.create_site(get_binding_site_name(bc.agent))

            # Handle modification conditions
            for mc in agent.mods:
                base_agent.create_mod_site(mc)

            # Handle mutation conditions
            for mc in agent.mutations:
                res_from = mc.residue_from if mc.residue_from else 'mut'
                res_to = mc.residue_to if mc.residue_to else 'X'
                if mc.position is None:
                    mut_site_name = res_from
                else:
                    mut_site_name = res_from + mc.position

                base_agent.create_site(mut_site_name, states=['WT', res_to])

            # Handle location condition
            if agent.location is not None:
                base_agent.create_site('loc', [_n(agent.location)])

            # Handle activity
            if agent.activity is not None:
                site_name = agent.activity.activity_type
                base_agent.create_site(site_name, ['inactive', 'active'])

        # There might be overwrites here
        for db_name, db_ref in agent.db_refs.items():
            base_agent.db_refs[db_name] = db_ref

        return base_agent
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;
}
246613
public void addModifier(String modifier) {
		if (!Strings.isEmpty(modifier)) {
			this.sarlAnnotationType.getModifiers().add(modifier);
		}
	}
778171
def modify(self, *, sort=None, purge=False, done=None):
        """"""
        return self._modifyInternal(sort=sort, purge=purge, done=done)
627958
public void merge(Mutation<E,K> m) {
        Preconditions.checkNotNull(m);

        if (null != m.additions) {
            if (null == additions) additions = m.additions;
            else additions.addAll(m.additions);
        }

        if (null != m.deletions) {
            if (null == deletions) deletions = m.deletions;
            else deletions.addAll(m.deletions);
        }
    }
509521
public static void addAction(Set<Action> aas, Action action, boolean condition) {

        if (condition) {
            aas.add(action);
        }
    }
731931
public void addModifier(Modifier modifier) {
		if (modifier != null) {
			final String ruleName = modifier.getType();
			if (!Strings.isEmpty(ruleName)) {
				List<String> modifiers = this.modifiers.get(ruleName);
				if (modifiers == null) {
					modifiers = new ArrayList<>();
					this.modifiers.put(ruleName, modifiers);
				}
				modifiers.addAll(modifier.getModifiers());
			}
		}
	}