Add capabilites to an existing base, all objects get the additional
    functionality, but don't get inited.  Use with great care!
337167
def add_capability(base, *classes):
    """"""
    if _debug: add_capability._debug("add_capability %r %r", base, classes)

    # start out with a collector
    if not issubclass(base, Collector):
        raise TypeError("base must be a subclass of Collector")

    # make sure you only add capabilities
    for cls in classes:
        if not issubclass(cls, Capability):
            raise TypeError("%s is not a Capability subclass" % (cls,))

    base.__bases__ += classes
    for cls in classes:
        base.__name__ += '+' + cls.__name__
423334
def add(self, name, extends, **kwargs):
        
        f = extends
        self._push(name=name,
                   module_=f.__module__,
                   class_=f.__name__,
                   method_=f.__name__,
                   is_class_=False,
                   **kwargs)
467117
def add_property(self, prop, objects=()):
        """"""
        self._properties.add(prop)
        self._objects |= objects
        self._pairs.update((o, prop) for o in objects)
1098608
private void grow(int newCapacity) {
    List<E> newElements = new ArrayList<E>(newCapacity);
    double[] newPriorities = new double[newCapacity];
    if (size > 0) {
      newElements.addAll(elements);
      System.arraycopy(priorities, 0, newPriorities, 0, priorities.length);
    }
    elements = newElements;
    priorities = newPriorities;
    capacity = newCapacity;
  }
328968
def put(self, name, base):
        '''
        
        '''
        async def fini():
            if self.base_by_name.get(name) is base:
                self.base_by_name.pop(name, None)

        # Remove myself from BaseRef when I fini
        base.onfini(fini)
        self.base_by_name[name] = base
244703
def add(self, urls):
        

        if isinstance(urls, (list, tuple)):
            self.urls.extend(urls)
        elif isinstance(urls, basestring):
            self.urls.append(urls)
        elif isinstance(urls, QuerySet):
            for obj in urls:
                self.urls.append(obj.get_absolute_url())
        elif hasattr(urls, 'get_absolute_url'):
            self.urls.append(urls.get_absolute_url())
        else:
            raise TypeError("Don't know how to handle %r" % urls)
384541
def add(name, options={}, &block)
      options = options[:_defaults].(name, options) if options[:_defaults] # FIXME: pipeline?
      base    = options[:_base]

      if options.delete(:inherit) and parent_property = get(name)
        base    = parent_property[:nested]
        options = parent_property.merge(options) # TODO: Definition#merge
      end

      if options[:_nested_builder]
        options[:nested] = build_nested(
          options.merge(
            _base: base,
            _name: name,
            _block: block,
          )
        )
      end

      # clean up, we don't want that stored in the Definition instance.
      [:_defaults, :_base, :_nested_builder, :_features].each { |key| options.delete(key) }

      self[name.to_s] = @definition_class.new(name, options)
    end
647748
def add_to(self, parent, additions):
        ""
        for x in additions:
            if x not in parent:
                parent.append(x)
                self.changed()
980301
@Override
  public Context addInheritsFrom(Context moreGeneral) throws KbTypeException, CreateException {
    return wrapped().addInheritsFrom(moreGeneral);
  }
621756
def add(self, *args, **kwargs):
        

        check_uniqueness = kwargs.pop('check_uniqueness', False)
        args = self.prepare_args(args)

        for index in self._indexes:
            index.add(*args, check_uniqueness=check_uniqueness and index.handle_uniqueness, **kwargs)
            if check_uniqueness and index.handle_uniqueness:
                check_uniqueness = False
899744
function(seneca, options, bases, next) {
        var add = [];
        var host = options.host;

        if (0 === bases.length) {
          if (null != host && host !== DEFAULT_HOST) {
            add.push(host + ":" + DEFAULT_PORT);
          }
          add.push(DEFAULT_HOST + ":" + DEFAULT_PORT);
        }

        next(add);
      }
420059
def add_objects!(objects, request_options = {})
      res = add_objects(objects, request_options)
      wait_task(res['taskID'], WAIT_TASK_DEFAULT_TIME_BEFORE_RETRY, request_options)
      res
    end
319221
def add_child(self, obj):
        """"""
        self.children.append(obj)
        obj.parents.append(self)
732383
def extend(self, builder):
        
        for extension in self._extensions:
            getattr(self, '_add_%s' % extension)(builder)

        builder.on_delete(self._on_delete)
339700
def add (self, ps):
        
        assert isinstance(ps, PropertySet)
        if ps not in self.added_:
            self.added_[ps] = create(self.all_ + ps.all())
        return self.added_[ps]
556396
private void addNewArtifactsItems(List<BaseArtifact> baseArtifacts, List<ArtifactItem> existingArtifactItems, ArtifactoryCollector collector) {
        long start = System.currentTimeMillis();
        List<BinaryArtifact> binaryArtifacts = new ArrayList<>();
        int count = 0;
        Set<ArtifactItem> existingSet = new HashSet<>(existingArtifactItems);
        for (BaseArtifact baseArtifact : baseArtifacts) {
            ArtifactItem newArtifactItem = baseArtifact.getArtifactItem();
            if (newArtifactItem != null && !existingSet.contains(newArtifactItem)) {
                newArtifactItem.setLastUpdated(System.currentTimeMillis());
                newArtifactItem.setCollectorId(collector.getId());
                newArtifactItem = artifactItemRepository.save(newArtifactItem);
                existingSet.add(newArtifactItem);
                BinaryArtifact binaryArtifact = baseArtifact.getBinaryArtifact();
                if (binaryArtifact != null) {
                    binaryArtifact.setCollectorItemId(newArtifactItem.getId());
                    binaryArtifacts.add(binaryArtifact);
                }
                count++;
            }
        }
        if (!binaryArtifacts.isEmpty()) {
            binaryArtifacts.forEach(binaryArtifact -> binaryArtifactRepository.save(binaryArtifact));
        }
        log("New artifacts", start, count);
    }
128353
@SuppressWarnings("ObjectAllocationInLoop")
    public void add(NodeBase source, NodeBase dest) {
        // amount of commutative nodes
        int n = 0;
        for (NodeBase node : source.getDescendants()) {
            if (node instanceof CommutativeOperator) {
                n++;
            }
        }
        for (int i = 0; i < 1 << n; i++) {
            Root root = new Root(source.getClone());
            int j = 0;
            for (NodeBase node : root.getDescendants()) {
                if (node instanceof CommutativeOperator) {
                    if ((i & 1 << j) != 0) {
                        ((CommutativeOperator) node).flipChildren();
                    }
                    j++;
                }
            }
            rules.add(new OptimizationRule(root.getChild(), dest));
        }
    }