Add new target alternative.
500015
def add_alternative (self, target_instance):
        
        assert isinstance(target_instance, AbstractTarget)
        if self.built_main_targets_:
            raise IllegalOperation ("add-alternative called when main targets are already created for project '%s'" % self.full_name ())

        self.alternatives_.append (target_instance)
755160
def insert_after(self, target):
        """"""
        if not target.parent:
            return
        target.parent.insert(target.parent.sprites.index(target) + 1, self)
617556
private function doAddMatchers()
    {
        if (!empty($this->newMatchers)) {
            $this->shell->addMatchers($this->newMatchers);
            $this->newMatchers = [];
        }
    }
617003
def add(self, **kwargs):
        """"""
        if "path" in kwargs:
            path = kwargs["path"]
            if isinstance(path, bytes):
                path = String(path)
            if not path[0].startswith("/"):
                paths = self.normalize_paths(self.path, path)
            else:
                paths = self.normalize_paths(path)
            kwargs["path"] = "/".join(paths)
        return self.create(self, **kwargs)
1355087
public static <E> void addInPlace(Counter<E> target, double value) {
    for (E key : target.keySet()) {
      target.incrementCount(key, value);
    }
  }
1249302
function extend(target, source) {
  var keys = Object.keys(source);
  for(var i = 0, len = keys.length; i < len; i++) {
    var key = keys[i];
    target[key] = source[key];
  }
  return target;
}
1362687
def success(self, request, message, extra_tags='', fail_silently=False):
        """"""
        add(self.target_name, request, constants.SUCCESS, message, extra_tags=extra_tags,
            fail_silently=fail_silently)
1245821
def add_for_targets(self, targets, classpath_elements):
    """"""
    for target in targets:
      self.add_for_target(target, classpath_elements)
245366
@Override
    public T add(final Asset asset, final String target) throws IllegalArgumentException {
        // Precondition checks
        Validate.notNullOrEmpty(target, "target must be specified");
        Validate.notNull(asset, "asset must be specified");

        // Make a Path from the target
        final ArchivePath path = new BasicPath(target);

        // Delegate
        return this.add(asset, path);
    }
1045134
def rename(self, target):
        
        if self._closed:
            self._raise_closed()
        self._accessor.rename(self, target)
977618
def add_method(info, target_cls, virtual=False, dont_replace=False):
    """"""

    # escape before prefixing, like pygobject
    name = escape_identifier(info.name)
    if virtual:
        name = "do_" + name
        attr = VirtualMethodAttribute(info, target_cls, name)
    else:
        attr = MethodAttribute(info, target_cls, name)

    if dont_replace and hasattr(target_cls, name):
        return

    setattr(target_cls, name, attr)
1115734
private void adopt(Label target) {
        if (target.code == this) {
            return; // already adopted
        }
        if (target.code != null) {
            throw new IllegalArgumentException("Cannot adopt label; it belongs to another Code");
        }
        target.code = this;
        labels.add(target);
    }
471241
def _inject_target(self, target_adaptor):
    """"""
    target_cls = self._target_types[target_adaptor.type_alias]

    declared_deps = target_adaptor.dependencies
    implicit_deps = (Address.parse(s,
                                   relative_to=target_adaptor.address.spec_path,
                                   subproject_roots=self._address_mapper.subproject_roots)
                     for s in target_cls.compute_dependency_specs(kwargs=target_adaptor.kwargs()))
    for dep in declared_deps:
      self._dependent_address_map[dep].add(target_adaptor.address)
    for dep in implicit_deps:
      self._implicit_dependent_address_map[dep].add(target_adaptor.address)
1046652
def add(self, name, target):
    ""
    if not isinstance(target, (table.Table, SyntheticTable)):
      raise TypeError(type(target), target)
    if name in self:
      # note: this is critical for avoiding cycles
      raise ScopeCollisionError('scope already has', name)
    self.names[name] = target
550733
def add_for_targets(self, targets, products):
    
    # TODO: This is a temporary helper for use until the classpath has been split.
    for target in targets:
      self.add_for_target(target, products)
1365753
public void addConfiguredTarget(final TargetDef target) {
    if (target == null) {
      throw new NullPointerException("target");
    }
    target.setProject(getProject());
    this.targetPlatforms.addElement(target);
  }
605244
def add_new_target(self, address, target_type, target_base=None, dependencies=None,
                     derived_from=None, **kwargs):
    
    rel_target_base = target_base or address.spec_path
    abs_target_base = os.path.join(get_buildroot(), rel_target_base)
    if not os.path.exists(abs_target_base):
      os.makedirs(abs_target_base)
      # TODO: Adding source roots on the fly like this is yucky, but hopefully this
      # method will go away entirely under the new engine. It's primarily used for injecting
      # synthetic codegen targets, and that isn't how codegen will work in the future.
    if not self.source_roots.find_by_path(rel_target_base):
      # TODO: Set the lang and root category (source/test/thirdparty) based on the target type?
      self.source_roots.add_source_root(rel_target_base)
    if dependencies:
      dependencies = [dep.address for dep in dependencies]

    self.build_graph.inject_synthetic_target(address=address,
                                             target_type=target_type,
                                             dependencies=dependencies,
                                             derived_from=derived_from,
                                             **kwargs)
    new_target = self.build_graph.get_target(address)

    return new_target