Create new percolator associated with the new set.
160076
def _new_percolator(spec, search_pattern):
    """"""
    if spec and search_pattern:
        query = query_string_parser(search_pattern=search_pattern).to_dict()
        for index in current_search.mappings.keys():
            # Create the percolator doc_type in the existing index for >= ES5
            # TODO: Consider doing this only once in app initialization
            percolator_doc_type = _get_percolator_doc_type(index)
            _create_percolator_mapping(index, percolator_doc_type)
            current_search_client.index(
                index=index, doc_type=percolator_doc_type,
                id='oaiset-{}'.format(spec),
                body={'query': query}
            )
266046
public Set<T> newColl(Collection<T> coll) {
	Set<T> newSet = this.create();
	newSet.addAll(coll);
	return newSet;
    }
1219717
def new_with_params(self, param_groups:Collection[Collection[nn.Parameter]]):
        ""
        opt_func = getattr(self, 'opt_func', self.opt.__class__)
        opt = opt_func([{'params': p, 'lr':0} for p in param_groups])
        opt = self.__class__(opt, wd=self.wd, true_wd=self.true_wd, bn_wd=self.bn_wd)
        opt.lr,opt.opt_func,opt.mom,opt.beta = self.lr,opt_func,self.mom,self.beta
        return opt
444679
def create(self, set):
        
        target_url = self.client.get_url('SET', 'POST', 'create')
        r = self.client.request('POST', target_url, json=set._serialize())
        return set._deserialize(r.json(), self)
1347455
private PairSet<T, I> createFromIndices(BinaryMatrix bm) {
		return new PairSet<T, I>(bm, allTransactions, allItems);
	}
1176998
public PTable makeNewPTable(FieldList record, Object key)
    {
        XTable xTable = new XTable(this, record, key);  // New empty table
        return xTable;
    }
1348430
def create_new_values(self):
        
        model = self.queryset.model
        pks = []
        extra_create_kwargs = self.extra_create_kwargs()
        for value in self._new_values:
            create_kwargs = {self.create_field: value}
            create_kwargs.update(extra_create_kwargs)
            new_item = self.create_item(**create_kwargs)
            pks.append(new_item.pk)
        return model.objects.filter(pk__in=pks)
384252
public static <T> HashSet<T> newHashSet(Collection<T> collection) {
		return newHashSet(false, collection);
	}
421265
def new(cls, shapes, start_x, start_y, x_scale, y_scale):
        
        return cls(
            shapes, int(round(start_x)), int(round(start_y)),
            x_scale, y_scale
        )
962416
def new(conf):
    """"""

    algorithm = conf.get("algorithm")
    salt = conf.get("salt").encode("utf-8")

    if algorithm == "none":
        return Hash(salt, None)
    elif algorithm.startswith("pbkdf2"):
        kwargs = {}
        tail = algorithm.partition(":")[2]
        for func, key in ((int, "iterations"), (int, "dklen"), (str, "func")):
            head, _, tail = tail.partition(":")
            if not head:
                break
            kwargs[key] = func(head)

        return PBKDF2(salt, **kwargs)
    else:
        return Hash(salt, algorithm)
985646
def _new_wire(self, source, sinks=None):
        """"""
        # Assign sequential routing key to new nets.
        wire = _Wire(source, sinks if sinks is not None else [], len(self._wires))
        self._wires.append(wire)

        return wire
323340
def collection_updated_percolator(mapper, connection, target):
    
    delete_collection_percolator(target)
    if target.dbquery is not None:
        new_collection_percolator(target)
291138
def create(name, dry_run, verbose, query=None, parent=None):
    """"""
    if parent is not None:
        parent = Collection.query.filter_by(name=parent).one().id
    collection = Collection(name=name, dbquery=query, parent_id=parent)
    db.session.add(collection)
    if verbose:
        click.secho('New collection: {0}'.format(collection))
103713
def create(self, validated_data):
        """"""
        # `partitions` field is renamed to `relationpartition_set` based on source of nested serializer
        partitions = validated_data.pop('relationpartition_set')

        with transaction.atomic():
            instance = Relation.objects.create(**validated_data)
            self._create_partitions(instance, partitions)

        return instance
1264047
def add_set(self):
        
        self.__label_counter += 1
        new_label = self.__label_counter
        self.__forest[new_label] = -1  # All new sets have their parent set to themselves
        self.__set_counter += 1
        return new_label
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;
  }
773297
def new(batch_size=None, **options):
    

    if batch_size:
        new_context = AutoContext(batch_size=batch_size, **options)
    else:
        new_context = Context(**options)

    _local.get_local_context().registry.append(new_context)

    return new_context